Changeset 15404 in webkit
- Timestamp:
- Jul 13, 2006, 1:56:52 AM (19 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSContextRef.cpp
r15376 r15404 63 63 } 64 64 65 JSValueRef JSEvaluate (JSContextRef context, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)65 JSValueRef JSEvaluateScript(JSContextRef context, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) 66 66 { 67 67 JSLock lock; … … 86 86 } 87 87 88 bool JSCheckS yntax(JSContextRef context, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)88 bool JSCheckScriptSyntax(JSContextRef context, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) 89 89 { 90 90 JSLock lock; -
trunk/JavaScriptCore/API/JSContextRef.h
r15376 r15404 72 72 @param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions. 73 73 @param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. 74 @param exception A pointer to a JSValueRef in which to store an uncaught exception, if any. Pass NULL if you do not care to store an uncaughtexception.75 @result The JSValue that results from evaluating script, or NULL if an uncaughtexception is thrown.74 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. 75 @result The JSValue that results from evaluating script, or NULL if an exception is thrown. 76 76 */ 77 JSValueRef JSEvaluate (JSContextRef context, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception);77 JSValueRef JSEvaluateScript(JSContextRef context, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception); 78 78 79 79 /*! 80 @function JSCheckS yntax80 @function JSCheckScriptSyntax 81 81 @abstract Checks for syntax errors in a string of JavaScript. 82 82 @param context The execution context to use. … … 87 87 @result true if the script is syntactically correct, otherwise false. 88 88 */ 89 bool JSCheckS yntax(JSContextRef context, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception);89 bool JSCheckScriptSyntax(JSContextRef context, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception); 90 90 91 91 #ifdef __cplusplus -
trunk/JavaScriptCore/API/JSNode.c
r15376 r15404 49 49 } else { 50 50 Node* node = JSObjectGetPrivate(thisObject); 51 Node* child = JSObjectGetPrivate(JSValueToObject(context, argv[0] ));51 Node* child = JSObjectGetPrivate(JSValueToObject(context, argv[0], NULL)); 52 52 53 53 Node_appendChild(node, child); … … 67 67 if (JSValueIsObjectOfClass(argv[0], JSNode_class(context))) { 68 68 Node* node = JSObjectGetPrivate(thisObject); 69 Node* child = JSObjectGetPrivate(JSValueToObject(context, argv[0] ));69 Node* child = JSObjectGetPrivate(JSValueToObject(context, argv[0], NULL)); 70 70 71 71 Node_removeChild(node, child); … … 87 87 if (JSValueIsObjectOfClass(argv[1], JSNode_class(context))) { 88 88 Node* node = JSObjectGetPrivate(thisObject); 89 Node* newChild = JSObjectGetPrivate(JSValueToObject(context, argv[0] ));90 Node* oldChild = JSObjectGetPrivate(JSValueToObject(context, argv[1] ));89 Node* newChild = JSObjectGetPrivate(JSValueToObject(context, argv[0], NULL)); 90 Node* oldChild = JSObjectGetPrivate(JSValueToObject(context, argv[1], NULL)); 91 91 92 92 Node_replaceChild(node, newChild, oldChild); -
trunk/JavaScriptCore/API/JSNodeList.c
r15376 r15404 34 34 NodeList* nodeList = JSObjectGetPrivate(thisObject); 35 35 assert(nodeList); 36 Node* node = NodeList_item(nodeList, JSValueToNumber(context, argv[0] ));36 Node* node = NodeList_item(nodeList, JSValueToNumber(context, argv[0], exception)); 37 37 if (node) 38 38 return JSNode_new(context, node); … … 75 75 NodeList* nodeList = JSObjectGetPrivate(thisObject); 76 76 assert(nodeList); 77 double index = JSValueToNumber(context, JSValueMakeString(propertyName) );77 double index = JSValueToNumber(context, JSValueMakeString(propertyName), exception); 78 78 unsigned uindex = index; 79 79 if (uindex == index) { // false for NaN -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r15385 r15404 97 97 } 98 98 99 JSStringRef JSObjectGetDescription(JSObjectRef object)100 {101 JSLock lock;102 JSObject* jsObject = toJS(object);103 return toRef(jsObject->className().rep());104 }105 106 99 JSValueRef JSObjectGetPrototype(JSObjectRef object) 107 100 { -
trunk/JavaScriptCore/API/JSObjectRef.h
r15385 r15404 386 386 /*! 387 387 @function 388 @abstract Gets a short description of a JavaScript object.389 @param context The execution context to use.390 @param object The object whose description you want to get.391 @result A JSString containing the object's description. This is usually the object's class name.392 */393 JSStringRef JSObjectGetDescription(JSObjectRef object);394 395 /*!396 @function397 388 @abstract Gets an object's prototype. 398 389 @param object A JSObject whose prototype you want to get. … … 466 457 /*! 467 458 @function 468 @abstract Tests whether an object is a function.459 @abstract Tests whether an object can be called as a function. 469 460 @param object The JSObject to test. 470 @result true if the object is a function, otherwise false.461 @result true if the object can be called as a function, otherwise false. 471 462 */ 472 463 bool JSObjectIsFunction(JSObjectRef object); … … 485 476 /*! 486 477 @function 487 @abstract Tests whether an object is a constructor.478 @abstract Tests whether an object can be called as a constructor. 488 479 @param object The JSObject to test. 489 @result true if the object is a constructor, otherwise false.480 @result true if the object can be called as a constructor, otherwise false. 490 481 */ 491 482 bool JSObjectIsConstructor(JSObjectRef object); -
trunk/JavaScriptCore/API/JSStringRef.cpp
r15400 r15404 69 69 UString::Rep* rep = toJS(string); 70 70 rep->deref(); 71 }72 73 JSStringRef JSValueToStringCopy(JSContextRef context, JSValueRef value)74 {75 JSLock lock;76 JSValue* jsValue = toJS(value);77 ExecState* exec = toJS(context);78 79 JSStringRef stringRef = toRef(jsValue->toString(exec).rep()->ref());80 if (exec->hadException())81 exec->clearException();82 return stringRef;83 71 } 84 72 -
trunk/JavaScriptCore/API/JSValueRef.cpp
r15376 r15404 110 110 } 111 111 112 bool JSValueIsEqual(JSContextRef context, JSValueRef a, JSValueRef b )112 bool JSValueIsEqual(JSContextRef context, JSValueRef a, JSValueRef b, JSValueRef* exception) 113 113 { 114 114 JSLock lock; … … 117 117 JSValue* jsB = toJS(b); 118 118 119 bool result = equal(exec, jsA, jsB); 120 if (exec->hadException()) 121 exec->clearException(); 119 bool result = equal(exec, jsA, jsB); // false if an exception is thrown 120 if (exec->hadException()) { 121 if (exception) 122 *exception = toRef(exec->exception()); 123 exec->clearException(); 124 } 122 125 return result; 123 126 } … … 130 133 JSValue* jsB = toJS(b); 131 134 132 bool result = strictEqual(exec, jsA, jsB); 133 if (exec->hadException()) 134 exec->clearException(); 135 bool result = strictEqual(exec, jsA, jsB); // can't throw because it doesn't perform value conversion 136 ASSERT(!exec->hadException()); 135 137 return result; 136 138 } … … 170 172 } 171 173 172 bool JSValueToBoolean(JSContextRef context, JSValueRef value )174 bool JSValueToBoolean(JSContextRef context, JSValueRef value, JSValueRef* exception) 173 175 { 174 176 JSLock lock; … … 178 180 bool boolean = jsValue->toBoolean(exec); 179 181 if (exec->hadException()) { 182 if (exception) 183 *exception = toRef(exec->exception()); 180 184 exec->clearException(); 181 185 boolean = false; … … 184 188 } 185 189 186 double JSValueToNumber(JSContextRef context, JSValueRef value )190 double JSValueToNumber(JSContextRef context, JSValueRef value, JSValueRef* exception) 187 191 { 188 192 JSLock lock; … … 192 196 double number = jsValue->toNumber(exec); 193 197 if (exec->hadException()) { 198 if (exception) 199 *exception = toRef(exec->exception()); 194 200 exec->clearException(); 195 201 number = NaN; … … 198 204 } 199 205 200 JSObjectRef JSValueToObject(JSContextRef context, JSValueRef value) 206 JSStringRef JSValueToStringCopy(JSContextRef context, JSValueRef value, JSValueRef* exception) 207 { 208 JSLock lock; 209 JSValue* jsValue = toJS(value); 210 ExecState* exec = toJS(context); 211 212 JSStringRef stringRef = toRef(jsValue->toString(exec).rep()->ref()); 213 if (exec->hadException()) { 214 if (exception) 215 *exception = toRef(exec->exception()); 216 exec->clearException(); 217 stringRef = 0; 218 } 219 return stringRef; 220 } 221 222 JSObjectRef JSValueToObject(JSContextRef context, JSValueRef value, JSValueRef* exception) 201 223 { 202 224 JSLock lock; … … 206 228 JSObjectRef objectRef = toRef(jsValue->toObject(exec)); 207 229 if (exec->hadException()) { 230 if (exception) 231 *exception = toRef(exec->exception()); 208 232 exec->clearException(); 209 233 objectRef = 0; -
trunk/JavaScriptCore/API/JSValueRef.h
r15376 r15404 125 125 /*! 126 126 @function 127 @abstract Tests whether two JavaScript values are equal, as compared by the JS == operator. 128 @param context The execution context to use. 129 @param a The first value to test. 130 @param b The second value to test. 131 @result true if the two values are equal, otherwise false. 132 */ 133 bool JSValueIsEqual(JSContextRef context, JSValueRef a, JSValueRef b); 127 @abstract Tests whether two JavaScript values are equal, as compared by the JS == operator. 128 @param context The execution context to use. 129 @param a The first value to test. 130 @param b The second value to test. 131 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. 132 @result true if the two values are equal, false if they are not equal or an exception is thrown. 133 */ 134 bool JSValueIsEqual(JSContextRef context, JSValueRef a, JSValueRef b, JSValueRef* exception); 134 135 135 136 /*! … … 204 205 @param context The execution context to use. 205 206 @param value The JSValue to convert. 206 @result The boolean result of conversion. 207 */ 208 bool JSValueToBoolean(JSContextRef context, JSValueRef value); 207 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. 208 @result The boolean result of conversion, or false if an exception is thrown. 209 */ 210 bool JSValueToBoolean(JSContextRef context, JSValueRef value, JSValueRef* exception); 209 211 210 212 /*! … … 213 215 @param context The execution context to use. 214 216 @param value The JSValue to convert. 215 @result The numeric result of conversion, or NaN if conversion fails. 216 */ 217 double JSValueToNumber(JSContextRef context, JSValueRef value); 217 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. 218 @result The numeric result of conversion, or NaN if an exception is thrown. 219 */ 220 double JSValueToNumber(JSContextRef context, JSValueRef value, JSValueRef* exception); 218 221 219 222 /*! … … 222 225 @param context The execution context to use. 223 226 @param value The JSValue to convert. 224 @result A JSString with the result of conversion, or an empty string if conversion fails. Ownership follows the Create Rule. 225 */ 226 JSStringRef JSValueToStringCopy(JSContextRef context, JSValueRef value); 227 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. 228 @result A JSString with the result of conversion, or NULL if an exception is thrown. Ownership follows the Create Rule. 229 */ 230 JSStringRef JSValueToStringCopy(JSContextRef context, JSValueRef value, JSValueRef* exception); 227 231 228 232 /*! … … 231 235 @param context The execution context to use. 232 236 @param value The JSValue to convert. 237 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. 233 238 @result The JSObject result of conversion, or NULL if conversion fails. 234 239 */ 235 JSObjectRef JSValueToObject(JSContextRef context, JSValueRef value );240 JSObjectRef JSValueToObject(JSContextRef context, JSValueRef value, JSValueRef* exception); 236 241 237 242 // Garbage collection -
trunk/JavaScriptCore/API/minidom.c
r15376 r15404 51 51 JSStringRef script = JSStringCreateWithUTF8CString(scriptUTF8); 52 52 JSValueRef exception; 53 JSValueRef result = JSEvaluate (context, script, NULL, NULL, 0, &exception);53 JSValueRef result = JSEvaluateScript(context, script, NULL, NULL, 0, &exception); 54 54 if (result) 55 55 printf("PASS: Test script executed successfully.\n"); 56 56 else { 57 57 printf("FAIL: Test script threw exception:\n"); 58 JSStringRef exceptionIString = JSValueToStringCopy(context, exception );58 JSStringRef exceptionIString = JSValueToStringCopy(context, exception, NULL); 59 59 CFStringRef exceptionCF = JSStringCopyCFString(kCFAllocatorDefault, exceptionIString); 60 60 CFShow(exceptionCF); … … 82 82 { 83 83 if (argc > 0) { 84 JSStringRef string = JSValueToStringCopy(context, argv[0] );84 JSStringRef string = JSValueToStringCopy(context, argv[0], NULL); 85 85 size_t numChars = JSStringGetMaximumUTF8CStringSize(string); 86 86 char stringUTF8[numChars]; -
trunk/JavaScriptCore/API/testapi.c
r15385 r15404 39 39 static void assertEqualsAsBoolean(JSValueRef value, bool expectedValue) 40 40 { 41 if (JSValueToBoolean(context, value ) != expectedValue)41 if (JSValueToBoolean(context, value, NULL) != expectedValue) 42 42 fprintf(stderr, "assertEqualsAsBoolean failed: %p, %d\n", value, expectedValue); 43 43 } … … 45 45 static void assertEqualsAsNumber(JSValueRef value, double expectedValue) 46 46 { 47 double number = JSValueToNumber(context, value );47 double number = JSValueToNumber(context, value, NULL); 48 48 if (number != expectedValue && !(isnan(number) && isnan(expectedValue))) 49 49 fprintf(stderr, "assertEqualsAsNumber failed: %p, %lf\n", value, expectedValue); … … 52 52 static void assertEqualsAsUTF8String(JSValueRef value, const char* expectedValue) 53 53 { 54 JSStringRef valueAsString = JSValueToStringCopy(context, value );54 JSStringRef valueAsString = JSValueToStringCopy(context, value, NULL); 55 55 56 56 size_t jsSize = JSStringGetMaximumUTF8CStringSize(valueAsString); … … 70 70 static void assertEqualsAsCharactersPtr(JSValueRef value, const char* expectedValue) 71 71 { 72 JSStringRef valueAsString = JSValueToStringCopy(context, value );72 JSStringRef valueAsString = JSValueToStringCopy(context, value, NULL); 73 73 74 74 size_t jsLength = JSStringGetLength(valueAsString); … … 196 196 197 197 if (argc > 0 && JSValueIsStrictEqual(context, argv[0], JSValueMakeNumber(0))) 198 return JSValueToObject(context, JSValueMakeNumber(1) );199 200 return JSValueToObject(context, JSValueMakeNumber(0) );198 return JSValueToObject(context, JSValueMakeNumber(1), NULL); 199 200 return JSValueToObject(context, JSValueMakeNumber(0), NULL); 201 201 } 202 202 … … 206 206 207 207 JSStringRef numberString = JSStringCreateWithUTF8CString("Number"); 208 JSObjectRef numberConstructor = JSValueToObject(context, JSObjectGetProperty(context, JSContextGetGlobalObject(context), numberString) );208 JSObjectRef numberConstructor = JSValueToObject(context, JSObjectGetProperty(context, JSContextGetGlobalObject(context), numberString), NULL); 209 209 JSStringRelease(numberString); 210 210 … … 219 219 switch (type) { 220 220 case kJSTypeBoolean: 221 return JSValueMakeBoolean(false); // default object conversion is 'true' 221 *exception = JSValueMakeNumber(2); 222 return NULL; 222 223 case kJSTypeNumber: 223 224 return JSValueMakeNumber(1); … … 269 270 270 271 if (argc > 0) { 271 JSStringRef string = JSValueToStringCopy(context, argv[0] );272 JSStringRef string = JSValueToStringCopy(context, argv[0], NULL); 272 273 size_t sizeUTF8 = JSStringGetMaximumUTF8CStringSize(string); 273 274 char stringUTF8[sizeUTF8]; … … 302 303 303 304 context = JSContextCreate(NULL); 304 305 306 JSObjectRef globalObject = JSContextGetGlobalObject(context); 307 assert(JSValueIsObject(globalObject)); 308 305 309 JSValueRef jsUndefined = JSValueMakeUndefined(); 306 310 JSValueRef jsNull = JSValueMakeNull(); … … 364 368 #endif // __APPLE__ 365 369 370 JSObjectRef myObject = JSObjectMake(context, MyObject_class(context), NULL); 371 assert(didInitialize); 372 JSStringRef myObjectIString = JSStringCreateWithUTF8CString("MyObject"); 373 JSObjectSetProperty(context, globalObject, myObjectIString, myObject, kJSPropertyAttributeNone); 374 JSStringRelease(myObjectIString); 375 376 JSValueRef exception; 377 366 378 // Conversions that throw exceptions 367 assert(NULL == JSValueToObject(context, jsNull)); 368 assert(isnan(JSValueToNumber(context, jsObjectNoProto))); 369 assertEqualsAsCharactersPtr(jsObjectNoProto, ""); 379 exception = NULL; 380 assert(NULL == JSValueToObject(context, jsNull, &exception)); 381 assert(exception); 382 383 exception = NULL; 384 assert(isnan(JSValueToNumber(context, jsObjectNoProto, &exception))); 385 assert(exception); 386 387 exception = NULL; 388 assert(!JSValueToStringCopy(context, jsObjectNoProto, &exception)); 389 assert(exception); 390 391 exception = NULL; 392 assert(!JSValueToBoolean(context, myObject, &exception)); 393 assert(exception); 394 395 exception = NULL; 396 assert(!JSValueIsEqual(context, jsObjectNoProto, JSValueMakeNumber(1), &exception)); 397 assert(exception); 370 398 371 399 assertEqualsAsBoolean(jsUndefined, false); … … 437 465 assert(!JSValueIsStrictEqual(context, jsOne, jsOneString)); 438 466 439 assert(JSValueIsEqual(context, jsOne, jsOneString ));440 assert(!JSValueIsEqual(context, jsTrue, jsFalse ));467 assert(JSValueIsEqual(context, jsOne, jsOneString, NULL)); 468 assert(!JSValueIsEqual(context, jsTrue, jsFalse, NULL)); 441 469 442 470 #if defined(__APPLE__) … … 458 486 JSValueUnprotect(jsGlobalValue); 459 487 460 /* JSInterpreter.h */461 462 JSObjectRef globalObject = JSContextGetGlobalObject(context);463 assert(JSValueIsObject(globalObject));464 465 488 JSStringRef goodSyntax = JSStringCreateWithUTF8CString("x = 1;"); 466 489 JSStringRef badSyntax = JSStringCreateWithUTF8CString("x := 1;"); 467 assert(JSCheckS yntax(context, goodSyntax, NULL, 0, NULL));468 assert(!JSCheckS yntax(context, badSyntax, NULL, 0, NULL));490 assert(JSCheckScriptSyntax(context, goodSyntax, NULL, 0, NULL)); 491 assert(!JSCheckScriptSyntax(context, badSyntax, NULL, 0, NULL)); 469 492 470 493 JSValueRef result; 471 JSValueRef exception;472 494 JSValueRef v; 473 495 JSObjectRef o; 474 496 475 result = JSEvaluate (context, goodSyntax, NULL, NULL, 1, NULL);497 result = JSEvaluateScript(context, goodSyntax, NULL, NULL, 1, NULL); 476 498 assert(result); 477 assert(JSValueIsEqual(context, result, jsOne ));499 assert(JSValueIsEqual(context, result, jsOne, NULL)); 478 500 479 501 exception = NULL; 480 result = JSEvaluate (context, badSyntax, NULL, NULL, 1, &exception);502 result = JSEvaluateScript(context, badSyntax, NULL, NULL, 1, &exception); 481 503 assert(!result); 482 504 assert(JSValueIsObject(exception)); … … 485 507 v = JSObjectGetProperty(context, globalObject, array); 486 508 assert(v); 487 JSObjectRef arrayConstructor = JSValueToObject(context, v );509 JSObjectRef arrayConstructor = JSValueToObject(context, v, NULL); 488 510 JSStringRelease(array); 489 511 result = JSObjectCallAsConstructor(context, arrayConstructor, 0, NULL, NULL); … … 499 521 assert(!JSObjectMakeFunctionWithBody(context, functionBody, NULL, 1, &exception)); 500 522 assert(JSValueIsObject(exception)); 501 v = JSObjectGetProperty(context, JSValueToObject(context, exception ), line);523 v = JSObjectGetProperty(context, JSValueToObject(context, exception, NULL), line); 502 524 assert(v); 503 525 assertEqualsAsNumber(v, 2); // FIXME: Lexer::setCode bumps startingLineNumber by 1 -- we need to change internal callers so that it doesn't have to (saying '0' to mean '1' in the API would be really confusing -- it's really confusing internally, in fact) … … 511 533 assert(JSObjectIsFunction(function)); 512 534 v = JSObjectCallAsFunction(context, function, NULL, 0, NULL, NULL); 513 assert(JSValueIsEqual(context, v, arrayConstructor ));535 assert(JSValueIsEqual(context, v, arrayConstructor, NULL)); 514 536 515 JSObjectRef myObject = JSObjectMake(context, MyObject_class(context), NULL);516 assert(didInitialize);517 JSStringRef myObjectIString = JSStringCreateWithUTF8CString("MyObject");518 JSObjectSetProperty(context, globalObject, myObjectIString, myObject, kJSPropertyAttributeNone);519 JSStringRelease(myObjectIString);520 521 537 JSStringRef print = JSStringCreateWithUTF8CString("print"); 522 538 JSObjectRef printFunction = JSObjectMakeFunction(context, print_callAsFunction); … … 552 568 JSStringRelease(functionBody); 553 569 v = JSObjectCallAsFunction(context, function, NULL, 0, NULL, NULL); 554 assert(JSValueIsEqual(context, v, globalObject ));570 assert(JSValueIsEqual(context, v, globalObject, NULL)); 555 571 v = JSObjectCallAsFunction(context, function, o, 0, NULL, NULL); 556 assert(JSValueIsEqual(context, v, o ));572 assert(JSValueIsEqual(context, v, o, NULL)); 557 573 558 574 char* scriptUTF8 = createStringWithContentsOfFile("testapi.js"); 559 575 JSStringRef script = JSStringCreateWithUTF8CString(scriptUTF8); 560 result = JSEvaluate (context, script, NULL, NULL, 1, &exception);576 result = JSEvaluateScript(context, script, NULL, NULL, 1, &exception); 561 577 if (JSValueIsUndefined(result)) 562 578 printf("PASS: Test script executed successfully.\n"); 563 579 else { 564 580 printf("FAIL: Test script returned unexcpected value:\n"); 565 JSStringRef exceptionIString = JSValueToStringCopy(context, exception );581 JSStringRef exceptionIString = JSValueToStringCopy(context, exception, NULL); 566 582 CFStringRef exceptionCF = JSStringCopyCFString(kCFAllocatorDefault, exceptionIString); 567 583 CFShow(exceptionCF); -
trunk/JavaScriptCore/API/testapi.js
r15384 r15404 73 73 shouldBe("MyObject()", undefined); 74 74 shouldBe("typeof new MyObject()", "object"); 75 shouldBe("MyObject ? 1 : 0", 0); // toBoolean75 shouldBe("MyObject ? 1 : 0", 2); // toBoolean -- should throw 2 76 76 shouldBe("+MyObject", 1); // toNumber 77 77 shouldBe("(MyObject.toString())", "[object CallbackObject]"); // toString -
trunk/JavaScriptCore/ChangeLog
r15400 r15404 1 2006-07-13 Geoffrey Garen <[email protected]> 2 3 Pleasing to Maciej. 4 5 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax 6 - Added exception out parameters to JSValueTo* and JSValueIsEqual because 7 they can throw 8 - Removed JSObjectGetDescription because it's useless and vague, and 9 JSValueToString/JSValueIsObjectOfClass do a better job, anyway 10 - Clarified comments about "IsFunction/Constructor" to indicate that they 11 are true of all functions/constructors, not just those created by JSObjectMake* 12 1 13 2006-07-12 Geoffrey Garen <[email protected]> 2 14 -
trunk/JavaScriptCore/JavaScriptCore.exp
r15385 r15404 2 2 .objc_class_name_WebScriptObjectPrivate 3 3 .objc_class_name_WebUndefined 4 _JSCheckS yntax4 _JSCheckScriptSyntax 5 5 _JSClassCreate 6 6 _JSClassRelease … … 9 9 _JSContextDestroy 10 10 _JSContextGetGlobalObject 11 _JSEvaluate 11 _JSEvaluateScript 12 12 _JSGarbageCollect 13 13 _JSObjectCallAsConstructor … … 15 15 _JSObjectCreatePropertyEnumerator 16 16 _JSObjectDeleteProperty 17 _JSObjectGetDescription18 17 _JSObjectGetPrivate 19 18 _JSObjectGetProperty
Note:
See TracChangeset
for help on using the changeset viewer.