Changeset 15310 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Jul 10, 2006, 2:17:26 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Darin.

Improved type safety by implementing opaque JSValue/JSObject typing through
abuse of 'const', not void*. Also fixed an alarming number of bugs
exposed by this new type safety.


I made one design change in JavaScriptCore, which is that the JSObject
constructor should take a JSValue* as its prototype argument, not a JSObject*,
since we allow the prototype to be any JSValue*, including jsNull(), for
example.


  • API/APICast.h: (toJS):
  • API/JSBase.h:
  • API/JSCallbackConstructor.cpp: (KJS::JSCallbackConstructor::construct):
  • API/JSCallbackFunction.cpp: (KJS::JSCallbackFunction::callAsFunction):
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject): (KJS::JSCallbackObject::getOwnPropertySlot): (KJS::JSCallbackObject::put): (KJS::JSCallbackObject::construct): (KJS::JSCallbackObject::callAsFunction): (KJS::JSCallbackObject::staticFunctionGetter):
  • API/JSCallbackObject.h:
  • API/JSContextRef.cpp: (JSEvaluate):
  • API/JSNode.c: (JSNodePrototype_appendChild): (JSNodePrototype_removeChild): (JSNodePrototype_replaceChild):
  • API/JSObjectRef.cpp: (JSObjectMake): (JSFunctionMakeWithBody): (JSObjectGetProperty): (JSObjectCallAsFunction): (JSObjectCallAsConstructor):
  • API/JSObjectRef.h:
  • API/testapi.c: (main):
  • ChangeLog:
  • kjs/object.h: (KJS::JSObject::JSObject):
File:
1 edited

Legend:

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

    r15224 r15310  
    106106     * @param proto The prototype
    107107     */
    108     JSObject(JSObject *proto, bool destructorIsThreadSafe = true);
     108    JSObject(JSValue* proto, bool destructorIsThreadSafe = true);
    109109
    110110    /**
     
    568568JSObject *throwError(ExecState *, ErrorType);
    569569
    570 inline JSObject::JSObject(JSObject *proto, bool destructorIsThreadSafe)
     570inline JSObject::JSObject(JSValue* proto, bool destructorIsThreadSafe)
    571571    : JSCell(destructorIsThreadSafe)
    572572    , _proto(proto)
Note: See TracChangeset for help on using the changeset viewer.