Changeset 51329 in webkit for trunk/JavaScriptCore/API
- Timestamp:
- Nov 23, 2009, 4:54:27 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/API
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSBase.cpp
r46431 r51329 47 47 JSLock lock(exec); 48 48 49 exec->globalData().clientData->willExecute(exec); 50 49 51 JSObject* jsThisObject = toJS(thisObject); 50 52 … … 54 56 Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), source, jsThisObject); 55 57 58 JSValueRef result = 0; 56 59 if (completion.complType() == Throw) { 57 60 if (exception) 58 61 *exception = toRef(exec, completion.value()); 59 return 0; 60 } 62 } else if (completion.value()) 63 result = toRef(exec, completion.value()); 64 else // happens, for example, when the only statement is an empty (';') statement 65 result = toRef(exec, jsUndefined()); 61 66 62 if (completion.value()) 63 return toRef(exec, completion.value()); 64 65 // happens, for example, when the only statement is an empty (';') statement 66 return toRef(exec, jsUndefined()); 67 exec->globalData().clientData->didExecute(exec); 68 return result; 67 69 } 68 70 -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r47412 r51329 393 393 JSLock lock(exec); 394 394 395 exec->globalData().clientData->willExecute(exec); 396 395 397 JSObject* jsObject = toJS(object); 396 398 JSObject* jsThisObject = toJS(thisObject); … … 403 405 argList.append(toJS(exec, arguments[i])); 404 406 407 JSValueRef result = 0; 408 405 409 CallData callData; 406 410 CallType callType = jsObject->getCallData(callData); 407 if (callType == CallTypeNone) 408 return 0; 409 410 JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList)); 411 if (exec->hadException()) { 412 if (exception) 413 *exception = toRef(exec, exec->exception()); 414 exec->clearException(); 415 result = 0; 416 } 411 if (callType != CallTypeNone) { 412 result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList)); 413 if (exec->hadException()) { 414 if (exception) 415 *exception = toRef(exec, exec->exception()); 416 exec->clearException(); 417 result = 0; 418 } 419 } 420 421 exec->globalData().clientData->didExecute(exec); 417 422 return result; 418 423 }
Note:
See TracChangeset
for help on using the changeset viewer.