Changeset 15376 in webkit for trunk/JavaScriptCore/API/minidom.c
- Timestamp:
- Jul 12, 2006, 1:12:08 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/minidom.c
r15328 r15376 40 40 JSObjectRef globalObject = JSContextGetGlobalObject(context); 41 41 42 JS InternalStringRef printIString = JSInternalStringCreateUTF8("print");43 JSObjectSetProperty(context, globalObject, printIString, JS FunctionMake(context, print), kJSPropertyAttributeNone);44 JS InternalStringRelease(printIString);42 JSStringRef printIString = JSStringCreateWithUTF8CString("print"); 43 JSObjectSetProperty(context, globalObject, printIString, JSObjectMakeFunction(context, print), kJSPropertyAttributeNone); 44 JSStringRelease(printIString); 45 45 46 JS InternalStringRef node = JSInternalStringCreateUTF8("Node");47 JSObjectSetProperty(context, globalObject, node, JS ConstructorMake(context, JSNode_construct), kJSPropertyAttributeNone);48 JS InternalStringRelease(node);46 JSStringRef node = JSStringCreateWithUTF8CString("Node"); 47 JSObjectSetProperty(context, globalObject, node, JSObjectMakeConstructor(context, JSNode_construct), kJSPropertyAttributeNone); 48 JSStringRelease(node); 49 49 50 50 char* scriptUTF8 = createStringWithContentsOfFile("minidom.js"); 51 JS InternalStringRef script = JSInternalStringCreateUTF8(scriptUTF8);51 JSStringRef script = JSStringCreateWithUTF8CString(scriptUTF8); 52 52 JSValueRef exception; 53 53 JSValueRef result = JSEvaluate(context, script, NULL, NULL, 0, &exception); … … 56 56 else { 57 57 printf("FAIL: Test script threw exception:\n"); 58 JS InternalStringRef exceptionIString = JSValueCopyStringValue(context, exception);59 CFStringRef exceptionCF = CFStringCreateWithJSInternalString(kCFAllocatorDefault, exceptionIString);58 JSStringRef exceptionIString = JSValueToStringCopy(context, exception); 59 CFStringRef exceptionCF = JSStringCopyCFString(kCFAllocatorDefault, exceptionIString); 60 60 CFShow(exceptionCF); 61 61 CFRelease(exceptionCF); 62 JS InternalStringRelease(exceptionIString);62 JSStringRelease(exceptionIString); 63 63 } 64 JS InternalStringRelease(script);64 JSStringRelease(script); 65 65 free(scriptUTF8); 66 66 … … 71 71 (void)o; 72 72 } 73 JSG CCollect();73 JSGarbageCollect(); 74 74 #endif 75 75 … … 82 82 { 83 83 if (argc > 0) { 84 JS InternalStringRef string = JSValueCopyStringValue(context, argv[0]);85 size_t numChars = JS InternalStringGetMaxLengthUTF8(string);84 JSStringRef string = JSValueToStringCopy(context, argv[0]); 85 size_t numChars = JSStringGetMaximumUTF8CStringSize(string); 86 86 char stringUTF8[numChars]; 87 JS InternalStringGetCharactersUTF8(string, stringUTF8, numChars);87 JSStringGetUTF8CString(string, stringUTF8, numChars); 88 88 printf("%s\n", stringUTF8); 89 89 } 90 90 91 return JS UndefinedMake();91 return JSValueMakeUndefined(); 92 92 } 93 93
Note:
See TracChangeset
for help on using the changeset viewer.