Changeset 34838 in webkit for trunk/JavaScriptCore/kjs/JSFunction.cpp
- Timestamp:
- Jun 27, 2008, 3:35:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSFunction.cpp
r34821 r34838 83 83 JSValue* JSFunction::call(ExecState* exec, JSValue* thisValue, const ArgList& args) 84 84 { 85 JSValue* exception = 0; 86 RegisterFileStack* stack = &exec->dynamicGlobalObject()->registerFileStack(); 87 RegisterFile* current = stack->current(); 88 if (!current->safeForReentry()) { 89 stack->pushFunctionRegisterFile(); 90 JSValue* result = exec->machine()->execute(body.get(), exec, this, thisValue->toThisObject(exec), args, stack, _scope.node(), &exception); 91 stack->popFunctionRegisterFile(); 92 exec->setException(exception); 93 return result; 94 } else { 95 JSValue* result = exec->machine()->execute(body.get(), exec, this, thisValue->toThisObject(exec), args, stack, _scope.node(), &exception); 96 current->setSafeForReentry(true); 97 exec->setException(exception); 98 return result; 99 } 85 return exec->machine()->execute(body.get(), exec, this, thisValue->toThisObject(exec), args, _scope.node(), exec->exceptionSlot()); 100 86 } 101 87 … … 196 182 JSObject* thisObj = new (exec) JSObject(proto); 197 183 198 JSValue* exception = 0; 199 JSValue* result = exec->machine()->execute(body.get(), exec, this, thisObj, args, &exec->dynamicGlobalObject()->registerFileStack(), _scope.node(), &exception); 200 if (exception) { 201 exec->setException(exception); 184 JSValue* result = exec->machine()->execute(body.get(), exec, this, thisObj, args, _scope.node(), exec->exceptionSlot()); 185 if (exec->hadException() || !result->isObject()) 202 186 return thisObj; 203 } 204 205 if (result->isObject()) 206 return static_cast<JSObject*>(result); 207 return thisObj; 187 return static_cast<JSObject*>(result); 208 188 } 209 189 … … 578 558 return throwError(exec, SyntaxError, errMsg, errLine, sourceId, NULL); 579 559 580 JSValue* exception = 0; 581 JSValue* value = exec->machine()->execute(evalNode.get(), exec, thisObject, &exec->dynamicGlobalObject()->registerFileStack(), globalObject->globalScopeChain().node(), &exception); 582 583 if (exception) { 584 exec->setException(exception); 585 return value; 586 } 587 588 return value ? value : jsUndefined(); 560 return exec->machine()->execute(evalNode.get(), exec, thisObject, globalObject->globalScopeChain().node(), exec->exceptionSlot()); 589 561 } 590 562
Note:
See TracChangeset
for help on using the changeset viewer.