summaryrefslogtreecommitdiff
path: root/js/src/jsfun.h
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 18:54:17 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:22 -0400
commit739a81958035410ddd9b230354a56c909cc5c816 (patch)
treea0114c15c2bddcba3592687e6ae510bc831df088 /js/src/jsfun.h
parente5019fd4cf2142b7fe2cbfedaefcea300390393e (diff)
downloaduxp-739a81958035410ddd9b230354a56c909cc5c816.tar.gz
1320408 - Part 2: Change JSFunction::getOrCreateScript to static method.
Diffstat (limited to 'js/src/jsfun.h')
-rw-r--r--js/src/jsfun.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/js/src/jsfun.h b/js/src/jsfun.h
index 65fe542c49..781ca62238 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 {