Bug 759246 (part 1) - Replace bce.sc with &sc where suitable. r=jorendorff.

This commit is contained in:
Nicholas Nethercote
2012-05-28 20:43:06 -07:00
parent 5453c632ef
commit 86dfb66865
2 changed files with 11 additions and 13 deletions

View File

@@ -118,14 +118,14 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
JS_ASSERT_IF(globalObj, JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(globalObj->getClass()));
GlobalScope globalScope(cx, globalObj);
bce.sc->setScopeChain(scopeChain);
sc.setScopeChain(scopeChain);
bce.globalScope = &globalScope;
if (!SetStaticLevel(bce.sc, staticLevel))
if (!SetStaticLevel(&sc, staticLevel))
return NULL;
/* If this is a direct call to eval, inherit the caller's strictness. */
if (callerFrame && callerFrame->isScriptFrame() && callerFrame->script()->strictModeCode)
bce.sc->setInStrictMode();
sc.setInStrictMode();
#ifdef DEBUG
bool savedCallerFun;
@@ -165,10 +165,8 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
* Inline this->statements to emit as we go to save AST space. We must
* generate our script-body blockid since we aren't calling Statements.
*/
uint32_t bodyid;
if (!GenerateBlockId(bce.sc, bodyid))
if (!GenerateBlockId(&sc, sc.bodyid))
return NULL;
bce.sc->bodyid = bodyid;
ParseNode *pn;
#if JS_HAS_XML_SUPPORT
@@ -201,7 +199,7 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
if (!AnalyzeFunctions(bce.parser))
return NULL;
bce.sc->functionList = NULL;
sc.functionList = NULL;
if (!EmitTree(cx, &bce, pn))
return NULL;