Reviewed by Maciej.
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jul 2006 02:02:47 +0000 (02:02 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jul 2006 02:02:47 +0000 (02:02 +0000)
commit7a4e942134828c0702792c16c90e0045d019e3b2
tree82ce4d7bce15edb5a188215fa60e590226b5d60e
parentc98c189d53264f45080a4672129bc75183c006c1
    Reviewed by Maciej.

        More API action.

        - Headerdoc finished

        Semantic Changes:
        - Added a JSContextRef argument to many functions, because you need a
        JSContextRef for doing virtually anything. I expect to add this argument
        to even more functions in a future patch.

        - Removed the globalObjectPrototype argument to JSContextCreate because
        you can't create an object until you have a context, so it's impossible
        to pass a prototype object to JSContextCreate. That's OK because (1) there's
        no reason to give the global object a prototype and (2) if you really want
        to, you can just use a separate call to JSObjectSetPrototype.

        - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
        and you need to be able to make the global object's class before you've
        created a JSContext.

        - Added an optional exception parameter to JSFunctionMakeWithBody because anything
        less would be uncivilized.

        - Made the return value parameter to JSObjectGetProperty optional to match
        all other return value parameters in the API.

        - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
        and JSCallbackConstructors. You could use an abstract base class or strategic
        placement of m_privateData in the class structure to implement this, but
        the former seemed like overkill, and the latter seemed too dangerous.

        - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.

        Cosmetic Changes:
        - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc

        - Removed function names from @function declarations because headeroc
        can parse them automatically, and I wanted to rule out manual mismatch.

        - Changed Error::create to take a const UString& instead of a UString*
        because it was looking at me funny.

        - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
        because the latter is more concise and it matches JSStringBufferCreateUTF8.

        * API/JSCallbackObject.cpp:
        (KJS::JSCallbackObject::getOwnPropertySlot):
        (KJS::JSCallbackObject::put):
        (KJS::JSCallbackObject::deleteProperty):
        (KJS::JSCallbackObject::getPropertyList):
        (KJS::JSCallbackObject::toBoolean):
        (KJS::JSCallbackObject::toNumber):
        (KJS::JSCallbackObject::toString):
        * API/JSClassRef.cpp:
        (JSClassCreate):
        * API/JSContextRef.cpp:
        (JSContextCreate):
        (JSContextSetException):
        * API/JSContextRef.h:
        * API/JSNode.c:
        (JSNodePrototype_class):
        (JSNode_class):
        * API/JSNodeList.c:
        (JSNodeListPrototype_class):
        (JSNodeList_class):
        * API/JSObjectRef.cpp:
        (JSObjectGetProperty):
        (JSObjectGetPrivate):
        (JSObjectSetPrivate):
        (JSObjectCallAsFunction):
        (JSObjectCallAsConstructor):
        (JSPropertyEnumeratorGetNext):
        * API/JSObjectRef.h:
        * API/JSStringBufferRef.cpp:
        (JSStringBufferCreateCF):
        * API/JSStringBufferRef.h:
        * API/JSValueRef.cpp:
        (JSValueIsInstanceOf):
        * API/JSValueRef.h:
        * API/minidom.c:
        (main):
        * API/minidom.js:
        * API/testapi.c:
        (MyObject_hasProperty):
        (MyObject_setProperty):
        (MyObject_deleteProperty):
        (MyObject_getPropertyList):
        (MyObject_convertToType):
        (MyObject_class):
        (main):
        * JavaScriptCore.exp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
JavaScriptCore/API/JSCallbackObject.cpp
JavaScriptCore/API/JSClassRef.cpp
JavaScriptCore/API/JSContextRef.cpp
JavaScriptCore/API/JSContextRef.h
JavaScriptCore/API/JSNode.c
JavaScriptCore/API/JSNodeList.c
JavaScriptCore/API/JSObjectRef.cpp
JavaScriptCore/API/JSObjectRef.h
JavaScriptCore/API/JSStringBufferRef.cpp
JavaScriptCore/API/JSStringBufferRef.h
JavaScriptCore/API/JSValueRef.cpp
JavaScriptCore/API/JSValueRef.h
JavaScriptCore/API/minidom.c
JavaScriptCore/API/testapi.c
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/kjs/function_object.cpp
JavaScriptCore/kjs/interpreter.cpp
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/object.cpp
JavaScriptCore/kjs/object.h