diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index e3fba17be2d5e..2041c801adeae 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -2748,6 +2748,127 @@ FUNCTION_EXTENDED ; } JS_PUBLIC_API +JSFunction +* +js +: +: +NewFunctionByIdWithReservedAndProto +( +JSContext +* +cx +JSNative +native +HandleObject +proto +unsigned +nargs +unsigned +flags +jsid +id +) +{ +MOZ_ASSERT +( +id +. +isAtom +( +) +) +; +MOZ_ASSERT +( +! +cx +- +> +zone +( +) +- +> +isAtomsZone +( +) +) +; +MOZ_ASSERT +( +native +) +; +CHECK_THREAD +( +cx +) +; +cx +- +> +check +( +id +) +; +Rooted +< +JSAtom +* +> +atom +( +cx +id +. +toAtom +( +) +) +; +FunctionFlags +funflags += +( +flags +& +JSFUN_CONSTRUCTOR +) +? +FunctionFlags +: +: +NATIVE_CTOR +: +FunctionFlags +: +: +NATIVE_FUN +; +return +NewFunctionWithProto +( +cx +native +nargs +funflags +nullptr +atom +proto +gc +: +: +AllocKind +: +: +FUNCTION_EXTENDED +TenuredObject +) +; +} +JS_PUBLIC_API const Value & diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 5d0606486f40f..e602d9d5de209 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -1358,6 +1358,33 @@ id ) ; JS_PUBLIC_API +JSFunction +* +NewFunctionByIdWithReservedAndProto +( +JSContext +* +cx +JSNative +native +JS +: +: +Handle +< +JSObject +* +> +proto +unsigned +nargs +unsigned +flags +jsid +id +) +; +JS_PUBLIC_API const JS :