Changeset 15307 in webkit for trunk/JavaScriptCore/API/minidom.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/minidom.c

    r15224 r15307  
    4040    JSObjectRef globalObject = JSContextGetGlobalObject(context);
    4141   
    42     JSStringBufferRef printBuf = JSStringBufferCreateUTF8("print");
     42    JSInternalStringRef printBuf = JSInternalStringCreateUTF8("print");
    4343    JSObjectSetProperty(context, globalObject, printBuf, JSFunctionMake(context, print), kJSPropertyAttributeNone);
    44     JSStringBufferRelease(printBuf);
     44    JSInternalStringRelease(printBuf);
    4545   
    46     JSStringBufferRef nodeBuf = JSStringBufferCreateUTF8("Node");
     46    JSInternalStringRef nodeBuf = JSInternalStringCreateUTF8("Node");
    4747    JSObjectSetProperty(context, globalObject, nodeBuf, JSConstructorMake(context, JSNode_construct), kJSPropertyAttributeNone);
    48     JSStringBufferRelease(nodeBuf);
     48    JSInternalStringRelease(nodeBuf);
    4949   
    5050    char* script = createStringWithContentsOfFile("minidom.js");
    51     JSStringBufferRef scriptBuf = JSStringBufferCreateUTF8(script);
     51    JSInternalStringRef scriptBuf = JSInternalStringCreateUTF8(script);
    5252    JSValueRef exception;
    5353    JSValueRef result = JSEvaluate(context, scriptBuf, NULL, NULL, 0, &exception);
     
    5656    else {
    5757        printf("FAIL: Test script threw exception:\n");
    58         JSStringBufferRef exceptionBuf = JSValueCopyStringValue(context, exception);
    59         CFStringRef exceptionCF = CFStringCreateWithJSStringBuffer(kCFAllocatorDefault, exceptionBuf);
     58        JSInternalStringRef exceptionBuf = JSValueCopyStringValue(context, exception);
     59        CFStringRef exceptionCF = CFStringCreateWithJSInternalString(kCFAllocatorDefault, exceptionBuf);
    6060        CFShow(exceptionCF);
    6161        CFRelease(exceptionCF);
    62         JSStringBufferRelease(exceptionBuf);
     62        JSInternalStringRelease(exceptionBuf);
    6363    }
    64     JSStringBufferRelease(scriptBuf);
     64    JSInternalStringRelease(scriptBuf);
    6565    free(script);
    6666
     
    8282{
    8383    if (argc > 0) {
    84         JSStringBufferRef stringBuf = JSValueCopyStringValue(context, argv[0]);
    85         size_t numChars = JSStringBufferGetMaxLengthUTF8(stringBuf);
     84        JSInternalStringRef stringBuf = JSValueCopyStringValue(context, argv[0]);
     85        size_t numChars = JSInternalStringGetMaxLengthUTF8(stringBuf);
    8686        char string[numChars];
    87         JSStringBufferGetCharactersUTF8(stringBuf, string, numChars);
     87        JSInternalStringGetCharactersUTF8(stringBuf, string, numChars);
    8888        printf("%s\n", string);
    8989    }
Note: See TracChangeset for help on using the changeset viewer.