Bug 883439 - Lazily parse scripts defined within catch blocks, r=luke.
This commit is contained in:
@@ -340,20 +340,21 @@ frontend::CompileLazyFunction(JSContext *cx, HandleFunction fun, LazyScript *laz
|
||||
Parser<FullParseHandler> parser(cx, options, chars, length,
|
||||
/* foldConstants = */ true, NULL, lazy);
|
||||
|
||||
RootedObject enclosingScope(cx, lazy->parentFunction());
|
||||
uint32_t staticLevel = lazy->staticLevel(cx);
|
||||
|
||||
ParseNode *pn = parser.standaloneLazyFunction(fun, lazy->staticLevel(), lazy->strict());
|
||||
ParseNode *pn = parser.standaloneLazyFunction(fun, staticLevel, lazy->strict());
|
||||
if (!pn)
|
||||
return false;
|
||||
|
||||
if (!NameFunctions(cx, pn))
|
||||
return false;
|
||||
|
||||
RootedObject enclosingScope(cx, lazy->enclosingScope());
|
||||
JS::RootedScriptSource sourceObject(cx, lazy->sourceObject());
|
||||
JS_ASSERT(sourceObject);
|
||||
|
||||
Rooted<JSScript*> script(cx, JSScript::Create(cx, enclosingScope, false,
|
||||
options, lazy->staticLevel(),
|
||||
options, staticLevel,
|
||||
sourceObject, lazy->begin(), lazy->end()));
|
||||
if (!script)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user