Bug 797469 - Avoid putting a JSFunction in Objectbox; r=jorendorff

This commit is contained in:
Eddy Bruel
2012-10-09 17:02:00 +02:00
parent 905d4a92de
commit 4e715508d7
4 changed files with 15 additions and 2 deletions

View File

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