Changeset 15233 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 8, 2006, 10:42:39 AM (19 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSObjectRef.cpp
r15225 r15233 218 218 JSObject* jsThisObject = toJS(thisObject); 219 219 220 if (!jsThisObject) 221 jsThisObject = exec->dynamicInterpreter()->globalObject(); 222 220 223 List argList; 221 224 for (size_t i = 0; i < argc; i++) … … 226 229 if (exception) 227 230 *exception = exec->exception(); 231 exec->clearException(); 228 232 result = NULL; 229 exec->clearException();230 233 } 231 234 return result; -
trunk/JavaScriptCore/API/JSObjectRef.h
r15225 r15233 442 442 @param context The execution context to use. 443 443 @param object The JSObject to call as a function. 444 @param thisObject The JSObject to use as 'this' in the function call.444 @param thisObject The object to use as "this," or NULL to use the global object as "this." 445 445 @param argc An integer count of the number of arguments in argv. 446 446 @param argv A JSValue array of the arguments to pass to the function. -
trunk/JavaScriptCore/API/testapi.c
r15225 r15233 602 602 JSClassRelease(nullCallbacksClass); 603 603 604 functionBuf = JSStringBufferCreateUTF8("return this;"); 605 function = JSFunctionMakeWithBody(context, functionBuf, NULL, 1, NULL); 606 JSStringBufferRelease(functionBuf); 607 v = JSObjectCallAsFunction(context, function, NULL, 0, NULL, NULL); 608 assert(JSValueIsEqual(context, v, globalObject)); 609 v = JSObjectCallAsFunction(context, function, o, 0, NULL, NULL); 610 assert(JSValueIsEqual(context, v, o)); 611 604 612 char* script = createStringWithContentsOfFile("testapi.js"); 605 613 JSStringBufferRef scriptBuf = JSStringBufferCreateUTF8(script); -
trunk/JavaScriptCore/ChangeLog
r15228 r15233 1 2006-07-08 Geoffrey Garen <[email protected]> 2 3 Reviewed by TimO. 4 5 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction, 6 to match JSEvaluate. 7 8 * API/JSObjectRef.cpp: 9 (JSObjectCallAsFunction): 10 * API/JSObjectRef.h: 11 * API/testapi.c: 12 (main): 13 1 14 === Safari-521.15 === 2 15
Note:
See TracChangeset
for help on using the changeset viewer.