Changeset 15307 in webkit for trunk/JavaScriptCore/API/JSNode.c


Ignore:
Timestamp:
Jul 10, 2006, 10:41:32 AM (19 years ago)
Author:
ggaren
Message:

Approved by Maciej, Darin.


Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
JavaScript engine's internal string representation, which is the most
low-level and efficient representation to use when interfacing with JavaScript.

  • API/APICast.h: (toJS): (toRef):
  • API/JSBase.h:
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::getOwnPropertySlot): (KJS::JSCallbackObject::put): (KJS::JSCallbackObject::deleteProperty): (KJS::JSCallbackObject::staticValueGetter): (KJS::JSCallbackObject::callbackGetter):
  • API/JSContextRef.cpp: (JSEvaluate): (JSCheckSyntax):
  • API/JSContextRef.h:
  • API/JSInternalStringRef.cpp: Added. (JSStringMake): (JSInternalStringCreate): (JSInternalStringCreateUTF8): (JSInternalStringRetain): (JSInternalStringRelease): (JSValueCopyStringValue): (JSInternalStringGetLength): (JSInternalStringGetCharactersPtr): (JSInternalStringGetCharacters): (JSInternalStringGetMaxLengthUTF8): (JSInternalStringGetCharactersUTF8): (JSInternalStringIsEqual): (JSInternalStringIsEqualUTF8): (JSInternalStringCreateCF): (CFStringCreateWithJSInternalString):
  • API/JSInternalStringRef.h: Added.
  • API/JSNode.c: (JSNodePrototype_appendChild): (JSNode_getNodeType): (JSNode_getChildNodes): (JSNode_getFirstChild):
  • API/JSNodeList.c: (JSNodeList_length): (JSNodeList_getProperty):
  • API/JSObjectRef.cpp: (JSFunctionMakeWithBody): (JSObjectGetDescription): (JSObjectHasProperty): (JSObjectGetProperty): (JSObjectSetProperty): (JSObjectDeleteProperty): (JSPropertyEnumeratorGetNext): (JSPropertyListAdd):
  • API/JSObjectRef.h:
  • API/JSStringBufferRef.cpp: Removed.
  • API/JSStringBufferRef.h: Removed.
  • API/JSValueRef.h:
  • API/JavaScriptCore.h:
  • API/minidom.c: (main): (print):
  • API/testapi.c: (assertEqualsAsUTF8String): (assertEqualsAsCharactersPtr): (assertEqualsAsCharacters): (MyObject_hasProperty): (MyObject_getProperty): (MyObject_setProperty): (MyObject_deleteProperty): (MyObject_getPropertyList): (print_callAsFunction): (myConstructor_callAsConstructor): (main):
  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSNode.c

    r15224 r15307  
    4040    // Example of throwing a type error for invalid values
    4141    if (!JSValueIsObjectOfClass(thisObject, JSNode_class(context))) {
    42         JSStringBufferRef messageBuf = JSStringBufferCreateUTF8("TypeError: appendChild can only be called on nodes");
     42        JSInternalStringRef messageBuf = JSInternalStringCreateUTF8("TypeError: appendChild can only be called on nodes");
    4343        JSContextSetException(context, JSStringMake(messageBuf));
    44         JSStringBufferRelease(messageBuf);
     44        JSInternalStringRelease(messageBuf);
    4545    } else if (argc < 1 || !JSValueIsObjectOfClass(argv[0], JSNode_class(context))) {
    46         JSStringBufferRef messageBuf = JSStringBufferCreateUTF8("TypeError: first argument to appendChild must be a node");
     46        JSInternalStringRef messageBuf = JSInternalStringCreateUTF8("TypeError: first argument to appendChild must be a node");
    4747        JSContextSetException(context, JSStringMake(messageBuf));
    48         JSStringBufferRelease(messageBuf);
     48        JSInternalStringRelease(messageBuf);
    4949    } else {
    5050        Node* node = JSObjectGetPrivate(thisObject);
     
    114114}
    115115
    116 static bool JSNode_getNodeType(JSContextRef context, JSObjectRef object, JSStringBufferRef propertyName, JSValueRef* returnValue)
     116static bool JSNode_getNodeType(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue)
    117117{
    118118    UNUSED_PARAM(context);
     
    121121    Node* node = JSObjectGetPrivate(object);
    122122    if (node) {
    123         JSStringBufferRef nodeBuf = JSStringBufferCreateUTF8(node->nodeType);
     123        JSInternalStringRef nodeBuf = JSInternalStringCreateUTF8(node->nodeType);
    124124        *returnValue = JSStringMake(nodeBuf);
    125         JSStringBufferRelease(nodeBuf);
     125        JSInternalStringRelease(nodeBuf);
    126126        return true;
    127127    }
     
    129129}
    130130
    131 static bool JSNode_getChildNodes(JSContextRef context, JSObjectRef thisObject, JSStringBufferRef propertyName, JSValueRef* returnValue)
     131static bool JSNode_getChildNodes(JSContextRef context, JSObjectRef thisObject, JSInternalStringRef propertyName, JSValueRef* returnValue)
    132132{
    133133    UNUSED_PARAM(propertyName);
     
    138138}
    139139
    140 static bool JSNode_getFirstChild(JSContextRef context, JSObjectRef object, JSStringBufferRef propertyName, JSValueRef* returnValue)
     140static bool JSNode_getFirstChild(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue)
    141141{
    142142    UNUSED_PARAM(context);
Note: See TracChangeset for help on using the changeset viewer.