diff options
Diffstat (limited to 'js/src/jsfun.h')
-rw-r--r-- | js/src/jsfun.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/js/src/jsfun.h b/js/src/jsfun.h index 65fe542c4..781ca6223 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -412,16 +412,15 @@ class JSFunction : public js::NativeObject // // - For functions known to have a JSScript, nonLazyScript() will get it. - JSScript* getOrCreateScript(JSContext* cx) { - MOZ_ASSERT(isInterpreted()); + static JSScript* getOrCreateScript(JSContext* cx, js::HandleFunction fun) { + MOZ_ASSERT(fun->isInterpreted()); MOZ_ASSERT(cx); - if (isInterpretedLazy()) { - JS::RootedFunction self(cx, this); - if (!createScriptForLazilyInterpretedFunction(cx, self)) + if (fun->isInterpretedLazy()) { + if (!createScriptForLazilyInterpretedFunction(cx, fun)) return nullptr; - return self->nonLazyScript(); + return fun->nonLazyScript(); } - return nonLazyScript(); + return fun->nonLazyScript(); } JSScript* existingScriptNonDelazifying() const { |