Changeset 15307 in webkit for trunk/JavaScriptCore/API/minidom.c
- Timestamp:
- Jul 10, 2006, 10:41:32 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/minidom.c
r15224 r15307 40 40 JSObjectRef globalObject = JSContextGetGlobalObject(context); 41 41 42 JS StringBufferRef printBuf = JSStringBufferCreateUTF8("print");42 JSInternalStringRef printBuf = JSInternalStringCreateUTF8("print"); 43 43 JSObjectSetProperty(context, globalObject, printBuf, JSFunctionMake(context, print), kJSPropertyAttributeNone); 44 JS StringBufferRelease(printBuf);44 JSInternalStringRelease(printBuf); 45 45 46 JS StringBufferRef nodeBuf = JSStringBufferCreateUTF8("Node");46 JSInternalStringRef nodeBuf = JSInternalStringCreateUTF8("Node"); 47 47 JSObjectSetProperty(context, globalObject, nodeBuf, JSConstructorMake(context, JSNode_construct), kJSPropertyAttributeNone); 48 JS StringBufferRelease(nodeBuf);48 JSInternalStringRelease(nodeBuf); 49 49 50 50 char* script = createStringWithContentsOfFile("minidom.js"); 51 JS StringBufferRef scriptBuf = JSStringBufferCreateUTF8(script);51 JSInternalStringRef scriptBuf = JSInternalStringCreateUTF8(script); 52 52 JSValueRef exception; 53 53 JSValueRef result = JSEvaluate(context, scriptBuf, NULL, NULL, 0, &exception); … … 56 56 else { 57 57 printf("FAIL: Test script threw exception:\n"); 58 JS StringBufferRef exceptionBuf = JSValueCopyStringValue(context, exception);59 CFStringRef exceptionCF = CFStringCreateWithJS StringBuffer(kCFAllocatorDefault, exceptionBuf);58 JSInternalStringRef exceptionBuf = JSValueCopyStringValue(context, exception); 59 CFStringRef exceptionCF = CFStringCreateWithJSInternalString(kCFAllocatorDefault, exceptionBuf); 60 60 CFShow(exceptionCF); 61 61 CFRelease(exceptionCF); 62 JS StringBufferRelease(exceptionBuf);62 JSInternalStringRelease(exceptionBuf); 63 63 } 64 JS StringBufferRelease(scriptBuf);64 JSInternalStringRelease(scriptBuf); 65 65 free(script); 66 66 … … 82 82 { 83 83 if (argc > 0) { 84 JS StringBufferRef stringBuf = JSValueCopyStringValue(context, argv[0]);85 size_t numChars = JS StringBufferGetMaxLengthUTF8(stringBuf);84 JSInternalStringRef stringBuf = JSValueCopyStringValue(context, argv[0]); 85 size_t numChars = JSInternalStringGetMaxLengthUTF8(stringBuf); 86 86 char string[numChars]; 87 JS StringBufferGetCharactersUTF8(stringBuf, string, numChars);87 JSInternalStringGetCharactersUTF8(stringBuf, string, numChars); 88 88 printf("%s\n", string); 89 89 }
Note:
See TracChangeset
for help on using the changeset viewer.