Reviewed by Darin.
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2006 21:17:26 +0000 (21:17 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2006 21:17:26 +0000 (21:17 +0000)
commitf8b1e44c1623eb2bc3afd2456725e26ccc8cbb0d
tree17fb6d4e6292c7d2aa4de4b5bb969f0d1e7b8ac9
parentff35971aac34aa3066feb6eac7d2bf0524977fa8
    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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
JavaScriptCore/API/APICast.h
JavaScriptCore/API/JSBase.h
JavaScriptCore/API/JSCallbackConstructor.cpp
JavaScriptCore/API/JSCallbackFunction.cpp
JavaScriptCore/API/JSCallbackObject.cpp
JavaScriptCore/API/JSCallbackObject.h
JavaScriptCore/API/JSContextRef.cpp
JavaScriptCore/API/JSNode.c
JavaScriptCore/API/JSObjectRef.cpp
JavaScriptCore/API/JSObjectRef.h
JavaScriptCore/API/testapi.c
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/object.h