Bug 701973 - Make callers pass the type of function body being parsed to Parser::functionBody, rather than inferring it from the current token. r=jorendorff

This commit is contained in:
Jeff Walden
2011-11-12 01:38:24 -08:00
parent b8910a7264
commit b056d6b138
4 changed files with 24 additions and 27 deletions

View File

@@ -429,14 +429,11 @@ frontend::CompileFunctionBody(JSContext *cx, JSFunction *fun, JSPrincipals *prin
}
/*
* Farble the body so that it looks like a block statement to EmitTree,
* which is called from EmitFunctionBody (see BytecodeEmitter.cpp).
* After we're done parsing, we must fold constants, analyze any nested
* functions, and generate code for this function, including a stop opcode
* at the end.
*/
tokenStream.mungeCurrentToken(TOK_LC);
ParseNode *pn = fn ? parser.functionBody() : NULL;
ParseNode *pn = fn ? parser.functionBody(Parser::StatementListBody) : NULL;
if (pn) {
if (!CheckStrictParameters(cx, &funbce)) {
pn = NULL;