Bug 433529: Part 1 - Statically resolve names for anonymous functions. r=jimb
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user