Bug 761914 (part 4) - Set SharedContext::staticLevel in the constructor. r=jorendorff.
This commit is contained in:
@@ -99,7 +99,7 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
|
||||
if (!parser.init())
|
||||
return NULL;
|
||||
|
||||
SharedContext sc(cx, scopeChain, /* fun = */ NULL, /* funbox = */ NULL);
|
||||
SharedContext sc(cx, scopeChain, /* fun = */ NULL, /* funbox = */ NULL, staticLevel);
|
||||
|
||||
TreeContext tc(&parser, &sc);
|
||||
if (!tc.init())
|
||||
@@ -119,7 +119,6 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
|
||||
|
||||
GlobalScope globalScope(cx, globalObj);
|
||||
bce.globalScope = &globalScope;
|
||||
sc.staticLevel = staticLevel;
|
||||
|
||||
/* If this is a direct call to eval, inherit the caller's strictness. */
|
||||
if (callerFrame && callerFrame->isScriptFrame() && callerFrame->script()->strictModeCode)
|
||||
@@ -263,7 +262,8 @@ frontend::CompileFunctionBody(JSContext *cx, JSFunction *fun,
|
||||
return false;
|
||||
|
||||
JS_ASSERT(fun);
|
||||
SharedContext funsc(cx, /* scopeChain = */ NULL, fun, /* funbox = */ NULL);
|
||||
SharedContext funsc(cx, /* scopeChain = */ NULL, fun, /* funbox = */ NULL,
|
||||
/* staticLevel = */ 0);
|
||||
|
||||
TreeContext funtc(&parser, &funsc);
|
||||
if (!funtc.init())
|
||||
|
||||
Reference in New Issue
Block a user