1320408 - Part 2: Change JSFunction::getOrCreateScript to static method.

This commit is contained in:
Gaming4JC 2019-06-08 18:54:17 -04:00 committed by Roy Tam
commit 07cd213071
28 changed files with 69 additions and 58 deletions

View file

@ -446,7 +446,7 @@ js::InternalCallOrConstruct(JSContext* cx, const CallArgs& args, MaybeConstruct
}
/* Invoke native functions. */
JSFunction* fun = &args.callee().as<JSFunction>();
RootedFunction fun(cx, &args.callee().as<JSFunction>());
if (construct != CONSTRUCT && fun->isClassConstructor()) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_CALL_CLASS_CONSTRUCTOR);
return false;
@ -457,7 +457,7 @@ js::InternalCallOrConstruct(JSContext* cx, const CallArgs& args, MaybeConstruct
return CallJSNative(cx, fun->native(), args);
}
if (!fun->getOrCreateScript(cx))
if (!JSFunction::getOrCreateScript(cx, fun))
return false;
/* Run function until JSOP_RETRVAL, JSOP_RETURN or error. */
@ -2999,7 +2999,7 @@ CASE(JSOP_FUNCALL)
{
MOZ_ASSERT(maybeFun);
ReservedRooted<JSFunction*> fun(&rootFunction0, maybeFun);
ReservedRooted<JSScript*> funScript(&rootScript0, fun->getOrCreateScript(cx));
ReservedRooted<JSScript*> funScript(&rootScript0, JSFunction::getOrCreateScript(cx, fun));
if (!funScript)
goto error;