Bug 887075 - Use original function when compiling lazy scripts, r=luke.
This commit is contained in:
@@ -358,10 +358,9 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain,
|
||||
}
|
||||
|
||||
bool
|
||||
frontend::CompileLazyFunction(JSContext *cx, HandleFunction fun, LazyScript *lazy,
|
||||
const jschar *chars, size_t length)
|
||||
frontend::CompileLazyFunction(JSContext *cx, LazyScript *lazy, const jschar *chars, size_t length)
|
||||
{
|
||||
JS_ASSERT(cx->compartment() == fun->compartment());
|
||||
JS_ASSERT(cx->compartment() == lazy->function()->compartment());
|
||||
|
||||
CompileOptions options(cx, lazy->version());
|
||||
options.setPrincipals(cx->compartment()->principals)
|
||||
@@ -377,6 +376,7 @@ frontend::CompileLazyFunction(JSContext *cx, HandleFunction fun, LazyScript *laz
|
||||
|
||||
uint32_t staticLevel = lazy->staticLevel(cx);
|
||||
|
||||
Rooted<JSFunction*> fun(cx, lazy->function());
|
||||
ParseNode *pn = parser.standaloneLazyFunction(fun, staticLevel, lazy->strict());
|
||||
if (!pn)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user