Changeset 27842 in webkit for trunk/JavaScriptCore/kjs/function_object.cpp
- Timestamp:
- Nov 15, 2007, 10:54:09 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function_object.cpp
r27448 r27842 186 186 187 187 // parse the source code 188 int s id;188 int sourceId; 189 189 int errLine; 190 190 UString errMsg; 191 RefPtr< ProgramNode> progNode = Parser::parse(sourceURL, lineNumber, body.data(),body.size(),&sid,&errLine,&errMsg);191 RefPtr<FunctionBodyNode> functionBody = parser().parseFunctionBody(sourceURL, lineNumber, body.data(), body.size(), &sourceId, &errLine, &errMsg); 192 192 193 193 // notify debugger that source has been parsed … … 195 195 if (dbg) { 196 196 // send empty sourceURL to indicate constructed code 197 bool cont = dbg->sourceParsed(exec, s id, UString(), body, lineNumber, errLine, errMsg);197 bool cont = dbg->sourceParsed(exec, sourceId, UString(), body, lineNumber, errLine, errMsg); 198 198 if (!cont) { 199 199 dbg->imp()->abort(); … … 203 203 204 204 // no program node == syntax error - throw a syntax error 205 if (! progNode)205 if (!functionBody) 206 206 // we can't return a Completion(Throw) here, so just set the exception 207 207 // and return it 208 return throwError(exec, SyntaxError, errMsg, errLine, s id, sourceURL);208 return throwError(exec, SyntaxError, errMsg, errLine, sourceId, sourceURL); 209 209 210 210 ScopeChain scopeChain; 211 211 scopeChain.push(exec->lexicalInterpreter()->globalObject()); 212 FunctionBodyNode *bodyNode = progNode.get(); 213 214 FunctionImp* fimp = new FunctionImp(exec, functionName, bodyNode, scopeChain); 212 213 FunctionImp* fimp = new FunctionImp(exec, functionName, functionBody.get(), scopeChain); 215 214 216 215 // parse parameter list. throw syntax error on illegal identifiers … … 232 231 c++, i++; 233 232 if (i == len) { 234 bodyNode->addParam(Identifier(param));233 functionBody->addParam(Identifier(param)); 235 234 params++; 236 235 break; 237 236 } else if (*c == ',') { 238 bodyNode->addParam(Identifier(param));237 functionBody->addParam(Identifier(param)); 239 238 params++; 240 239 c++, i++;
Note:
See TracChangeset
for help on using the changeset viewer.