Bug 887075 - Use original function when compiling lazy scripts, r=luke.

This commit is contained in:
Brian Hackett
2013-07-15 14:53:13 -06:00
parent bfe9b428d0
commit e9fac003ec
6 changed files with 36 additions and 18 deletions

View File

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