Bug 740446 - make 'arguments' more like a normal local binding (r=bhackett)

This commit is contained in:
Luke Wagner
2012-04-02 08:58:30 -07:00
parent e113a1c7f0
commit 25fcd79275
50 changed files with 603 additions and 999 deletions

View File

@@ -361,7 +361,7 @@ frontend::CompileFunctionBody(JSContext *cx, JSFunction *fun,
funbce.flags |= TCF_IN_FUNCTION;
funbce.setFunction(fun);
funbce.bindings.transfer(cx, bindings);
fun->setArgCount(funbce.bindings.countArgs());
fun->setArgCount(funbce.bindings.numArgs());
if (!GenerateBlockId(&funbce, funbce.bodyid))
return false;
@@ -398,9 +398,7 @@ frontend::CompileFunctionBody(JSContext *cx, JSFunction *fun,
*/
ParseNode *pn = fn ? parser.functionBody(Parser::StatementListBody) : NULL;
if (pn) {
if (!CheckStrictParameters(cx, &funbce)) {
pn = NULL;
} else if (!tokenStream.matchToken(TOK_EOF)) {
if (!tokenStream.matchToken(TOK_EOF)) {
parser.reportErrorNumber(NULL, JSREPORT_ERROR, JSMSG_SYNTAX_ERROR);
pn = NULL;
} else if (!FoldConstants(cx, pn, &funbce)) {