Ignore:
Timestamp:
Dec 28, 2006, 5:44:28 PM (18 years ago)
Author:
ggaren
Message:

JavaScriptCore:

Reviewed by Brady Eidson.


Some cleanup in preparation for fixing <rdar://problem/4608404>
WebScriptObject's _executionContext lack of ownership policy causes
crashes (e.g., in Dashcode)


I'm just trying to make heads or tails of this baffling code.


Renamed "root" | "execContext" | "executionContext" => "rootObject", because
that's the object's (admittedly vague) type name.


  • bindings/runtime.cpp: Removed createLanguageInstanceForValue because I'll give you a dollar if you can explain to me what it actually did.


  • bindings/runtime_root.cpp: Put everything in the KJS::Bindings namespace, removing the KJS::Bindings prefix from individual functions and datatypes. This matches the header and eliminates a lot of syntax cruft.


  • bindings/c/c_utility.cpp: (KJS::Bindings::convertValueToNPVariant): Replaced use of createLanguageInstanceForValue with call to _NPN_CreateScriptObject because that's what createLanguageInstanceForValue actually did (but don't ask me for that dollar now; that's cheating.)
  • bindings/objc/objc_utility.h:
  • bindings/objc/objc_utility.mm: (KJS::Bindings::convertValueToObjcValue): Removed. Its only purpose was to call a single function for WebKit, which WebKit can do on its own.
  • kjs/interpreter.h: Removed rtti() because it was unused, and this class is scheduled for demolition anyway.


  • kjs/interpreter.cpp: Removed createLanguageInstanceForValue because it had nothing to do with the Interpreter, and nothing makes Chuck Norris more mad than a function whose sole purpose is to call another function of the same name. (Really, I asked him.)

WebCore:

Reviewed by Brady Eidson.


Some cleanup in preparation for fixing <rdar://problem/4608404>
WebScriptObject's _executionContext lack of ownership policy causes
crashes (e.g., in Dashcode)


Layout tests pass.

Renamed "root" | "execContext" | "executionContext" => rootObject, because
that's the object's (admittedly vague) type name.


  • bindings/js/kjs_binding.cpp:
  • bindings/js/kjs_binding.h: Removed createLanguageInstanceForValue and createObjcInstanceForValue because their only purpose was to confuse you.


  • bindings/objc/DOMInternal.h: Moved declaration of createDOMWrapper here. createDOMWrapper is the new name for createObjcInstanceForValue.


  • bindings/objc/DOMInternal.mm: Renamed Interpreter::createObjcInstanceForValue to createDOMWrapper because creating DOM wrappers has nothing to do with the interpreter, and everything to do with the DOM. Renamed value to object because it is one. Removed newObj nil check that is unnecessary in ObjC.
  • bindings/objc/WebScriptObject.mm: Replaced call to createLanguageInstanceForValue with explicit code to do the same thing it would have done: (1) try to create a DOM wrapper; (2) if the object is not a wrappable DOM object, create a vanilla WebScriptObject for it instead.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/interpreter.h

    r15990 r18461  
    3939  class TimeoutChecker;
    4040 
    41   namespace Bindings {
    42     class RootObject;
    43   }
    44 
    4541  /**
    4642   * Interpreter objects can be used to evaluate ECMAScript code. Each
     
    258254    virtual void mark(bool currentThreadIsMainThread);
    259255
    260     /**
    261      * Provides a way to distinguish derived classes.
    262      * Only useful if you reimplement Interpreter and if different kind of
    263      * interpreters are created in the same process.
    264      * The base class returns 0, the ECMA-bindings interpreter returns 1.
    265      */
    266     virtual int rtti() { return 0; }
    267 
    268256#ifdef KJS_DEBUG_MEM
    269257    /**
     
    305293    virtual bool isSafeScript(const Interpreter*) { return true; }
    306294 
    307     virtual void *createLanguageInstanceForValue(ExecState*, int language, JSObject* value, const Bindings::RootObject* origin, const Bindings::RootObject* current);
    308 
    309295    // This is a workaround to avoid accessing the global variables for these identifiers in
    310296    // important property lookup functions, to avoid taking PIC branches in Mach-O binaries
Note: See TracChangeset for help on using the changeset viewer.