Changeset 15149 in webkit for trunk/JavaScriptCore/API/minidom.c
- Timestamp:
- Jul 3, 2006, 7:35:09 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/minidom.c
r15133 r15149 50 50 char* script = createStringWithContentsOfFile("minidom.js"); 51 51 JSCharBufferRef scriptBuf = JSCharBufferCreateUTF8(script); 52 JSValueRef result; 53 JSEvaluate(context, globalObject, scriptBuf, NULL, 0, &result); 54 55 if (JSValueIsUndefined(result)) 52 JSValueRef exception; 53 JSValueRef result = JSEvaluate(context, scriptBuf, NULL, NULL, 0, &exception); 54 if (result) 56 55 printf("PASS: Test script executed successfully.\n"); 57 56 else { 58 printf("FAIL: Test script returned unexcpected value:\n");59 JSCharBufferRef resultBuf = JSValueCopyStringValue(context, result);60 CFStringRef resultCF = CFStringCreateWithJSCharBuffer(kCFAllocatorDefault, resultBuf);61 CFShow( resultCF);62 CFRelease( resultCF);63 JSCharBufferRelease( resultBuf);57 printf("FAIL: Test script threw exception:\n"); 58 JSCharBufferRef exceptionBuf = JSValueCopyStringValue(context, exception); 59 CFStringRef exceptionCF = CFStringCreateWithJSCharBuffer(kCFAllocatorDefault, exceptionBuf); 60 CFShow(exceptionCF); 61 CFRelease(exceptionCF); 62 JSCharBufferRelease(exceptionBuf); 64 63 } 65 64 JSCharBufferRelease(scriptBuf);
Note:
See TracChangeset
for help on using the changeset viewer.