Bug 433529: Part 1 - Statically resolve names for anonymous functions. r=jimb

This commit is contained in:
Alex Crichton
2012-08-18 21:33:20 -07:00
parent 5090815af5
commit 2e6698063f
4 changed files with 334 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
#include "frontend/BytecodeEmitter.h"
#include "frontend/FoldConstants.h"
#include "frontend/NameFunctions.h"
#include "vm/GlobalObject.h"
#include "jsinferinlines.h"
@@ -191,6 +192,8 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *call
if (!FoldConstants(cx, pn, &parser))
return NULL;
if (!NameFunctions(cx, pn))
return NULL;
pc.functionList = NULL;
@@ -331,6 +334,9 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions
if (!funbce.init())
return false;
if (!NameFunctions(cx, pn))
return NULL;
if (fn->pn_body) {
JS_ASSERT(fn->pn_body->isKind(PNK_ARGSBODY));
fn->pn_body->append(pn);