summaryrefslogtreecommitdiffstats
path: root/js/src/jsfriendapi.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /js/src/jsfriendapi.cpp
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jsfriendapi.cpp')
-rw-r--r--js/src/jsfriendapi.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp
index 694058f6c9..574e61248e 100644
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -420,6 +420,23 @@ JS_PUBLIC_API JSFunction* js::NewFunctionByIdWithReserved(
gc::AllocKind::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& js::GetFunctionNativeReserved(JSObject* fun,
size_t which) {
MOZ_ASSERT(fun->as<JSFunction>().isNativeFun());