Bug 761914 (part 4) - Set SharedContext::staticLevel in the constructor. r=jorendorff.

This commit is contained in:
Nicholas Nethercote
2012-06-07 18:48:38 -07:00
parent b824763ab3
commit e16b5af445
5 changed files with 22 additions and 21 deletions

View File

@@ -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())