diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp index bd6b540f2dc0..bbfb53188bb6 100644 --- a/js/src/frontend/BytecodeCompiler.cpp +++ b/js/src/frontend/BytecodeCompiler.cpp @@ -150,7 +150,10 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *call * function captured in case it refers to an upvar, and someone * wishes to decompile it while it's running. */ - ObjectBox *funbox = parser.newObjectBox(callerFrame->fun()); + JSFunction *fun = callerFrame->fun(); + ObjectBox *funbox = parser.newFunctionBox(fun, &pc, + fun->inStrictMode() ? StrictMode::STRICT + : StrictMode::NOTSTRICT); if (!funbox) return NULL; bce.objectList.add(funbox); diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp index e368b8e22c8c..0b4a4ddf89fe 100644 --- a/js/src/frontend/ParseNode.cpp +++ b/js/src/frontend/ParseNode.cpp @@ -797,6 +797,15 @@ ObjectBox::ObjectBox(JSObject *object, ObjectBox* traceLink) traceLink(traceLink), emitLink(NULL) { + JS_ASSERT(!object->isFunction()); +} + +ObjectBox::ObjectBox(JSFunction *function, ObjectBox* traceLink) + : object(function), + traceLink(traceLink), + emitLink(NULL) +{ + JS_ASSERT(object->isFunction()); } void diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index 62c6c0286ac3..30c356d30d4a 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -1471,6 +1471,8 @@ class ObjectBox { ObjectBox *traceLink; ObjectBox *emitLink; + + ObjectBox(JSFunction *function, ObjectBox *traceLink); }; } /* namespace frontend */ diff --git a/js/src/frontend/SharedContext.h b/js/src/frontend/SharedContext.h index 3ac6c882e4d5..bdf2bc14b74f 100644 --- a/js/src/frontend/SharedContext.h +++ b/js/src/frontend/SharedContext.h @@ -222,7 +222,6 @@ class FunctionBox : public ObjectBox, public SharedContext funCxFlags.definitelyNeedsArgsObj = true; } }; - /* * NB: If you add a new type of statement that is a scope, add it between * STMT_WITH and STMT_CATCH, or you will break StmtInfoBase::linksScope. If you