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


Ignore:
Timestamp:
Jul 10, 2006, 10:37:00 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Darin.


  • Changed public header includes to the <JavaScriptCore/ style.
  • Changed instances of 'buffer' to 'string' since we decided on JSInternalString instead of JSStringBuffer.
  • API/JSContextRef.h:
  • API/JSInternalStringRef.cpp: (JSStringMake): (JSInternalStringRetain): (JSInternalStringRelease): (JSValueCopyStringValue): (JSInternalStringGetLength): (JSInternalStringGetCharactersPtr): (JSInternalStringGetCharacters): (JSInternalStringGetMaxLengthUTF8): (JSInternalStringGetCharactersUTF8): (CFStringCreateWithJSInternalString):
  • API/JSInternalStringRef.h:
  • API/JSNode.c: (JSNodePrototype_appendChild): (JSNode_getNodeType):
  • API/JSObjectRef.cpp: (JSObjectCallAsConstructor):
  • API/JSValueRef.h:
  • API/JavaScriptCore.h:
  • API/minidom.c: (main): (print):
  • API/testapi.c: (MyObject_getPropertyList): (myConstructor_callAsConstructor): (main): I noticed that we were prematurely releasing some string buffers, so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf (sometimes changing to 'IString', when necessary to differentiate a variable) to match the buffer->string change.
File:
1 edited

Legend:

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

    r15317 r15328  
    4040    // Example of throwing a type error for invalid values
    4141    if (!JSValueIsObjectOfClass(thisObject, JSNode_class(context))) {
    42         JSInternalStringRef messageBuf = JSInternalStringCreateUTF8("TypeError: appendChild can only be called on nodes");
    43         *exception = JSStringMake(messageBuf);
    44         JSInternalStringRelease(messageBuf);
     42        JSInternalStringRef message = JSInternalStringCreateUTF8("TypeError: appendChild can only be called on nodes");
     43        *exception = JSStringMake(message);
     44        JSInternalStringRelease(message);
    4545    } else if (argc < 1 || !JSValueIsObjectOfClass(argv[0], JSNode_class(context))) {
    46         JSInternalStringRef messageBuf = JSInternalStringCreateUTF8("TypeError: first argument to appendChild must be a node");
    47         *exception = JSStringMake(messageBuf);
    48         JSInternalStringRelease(messageBuf);
     46        JSInternalStringRef message = JSInternalStringCreateUTF8("TypeError: first argument to appendChild must be a node");
     47        *exception = JSStringMake(message);
     48        JSInternalStringRelease(message);
    4949    } else {
    5050        Node* node = JSObjectGetPrivate(thisObject);
     
    121121    Node* node = JSObjectGetPrivate(object);
    122122    if (node) {
    123         JSInternalStringRef nodeBuf = JSInternalStringCreateUTF8(node->nodeType);
    124         *returnValue = JSStringMake(nodeBuf);
    125         JSInternalStringRelease(nodeBuf);
     123        JSInternalStringRef nodeType = JSInternalStringCreateUTF8(node->nodeType);
     124        *returnValue = JSStringMake(nodeType);
     125        JSInternalStringRelease(nodeType);
    126126        return true;
    127127    }
Note: See TracChangeset for help on using the changeset viewer.