Changeset 9929 in webkit for trunk/JavaScriptCore/kjs/function.cpp
- Timestamp:
- Jul 27, 2005, 4:10:48 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function.cpp
r9889 r9929 78 78 Object &globalObj = exec->dynamicInterpreter()->globalObject(); 79 79 80 // enter a new execution context 81 ContextImp ctx(globalObj, exec->dynamicInterpreter()->imp(), thisObj, codeType(), 82 exec->context().imp(), this, &args); 83 ExecState newExec(exec->dynamicInterpreter(), &ctx); 84 newExec.setException(exec->exception()); // could be null 85 86 // assign user supplied arguments to parameters 87 processParameters(&newExec, args); 88 // add variable declarations (initialized to undefined) 89 processVarDecls(&newExec); 90 80 91 Debugger *dbg = exec->dynamicInterpreter()->imp()->debugger(); 81 92 int sid = -1; … … 88 99 89 100 Object func(this); 90 bool cont = dbg->callEvent( exec,sid,lineno,func,args);101 bool cont = dbg->callEvent(&newExec,sid,lineno,func,args); 91 102 if (!cont) { 92 103 dbg->imp()->abort(); … … 95 106 } 96 107 97 // enter a new execution context98 ContextImp ctx(globalObj, exec->dynamicInterpreter()->imp(), thisObj, codeType(),99 exec->context().imp(), this, &args);100 ExecState newExec(exec->dynamicInterpreter(), &ctx);101 newExec.setException(exec->exception()); // could be null102 103 // assign user supplied arguments to parameters104 processParameters(&newExec, args);105 // add variable declarations (initialized to undefined)106 processVarDecls(&newExec);107 108 108 Completion comp = execute(&newExec); 109 109 110 110 // if an exception occured, propogate it back to the previous execution object 111 111 if (newExec.hadException()) 112 exec->setException(newExec.exception());112 comp = Completion(Throw, newExec.exception()); 113 113 114 114 #ifdef KJS_VERBOSE … … 122 122 123 123 if (dbg) { 124 if (inherits(&DeclaredFunctionImp::info)) 125 lineno = static_cast<DeclaredFunctionImp*>(this)->body->lastLine(); 126 127 if (comp.complType() == Throw) 128 newExec.setException(comp.value()); 129 124 130 Object func(this); 125 int cont = dbg->returnEvent( exec,sid,lineno,func);131 int cont = dbg->returnEvent(&newExec,sid,lineno,func); 126 132 if (!cont) { 127 133 dbg->imp()->abort(); … … 790 796 UString errMsg; 791 797 ProgramNode *progNode = Parser::parse(UString(), 0, s.data(),s.size(),&sid,&errLine,&errMsg); 792 798 799 Debugger *dbg = exec->dynamicInterpreter()->imp()->debugger(); 800 if (dbg) { 801 bool cont = dbg->sourceParsed(exec, sid, UString(), s, errLine); 802 if (!cont) 803 return Undefined(); 804 } 805 793 806 // no program node means a syntax occurred 794 807 if (!progNode) {
Note:
See TracChangeset
for help on using the changeset viewer.