summaryrefslogtreecommitdiffstats
path: root/js/public/CallArgs.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /js/public/CallArgs.h
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/public/CallArgs.h')
-rw-r--r--js/public/CallArgs.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/public/CallArgs.h b/js/public/CallArgs.h
index 16f8d6f904..8be1b382f2 100644
--- a/js/public/CallArgs.h
+++ b/js/public/CallArgs.h
@@ -112,7 +112,7 @@ class MOZ_STACK_CLASS NoUsedRval {
};
template <class WantUsedRval>
-class MOZ_STACK_CLASS CallArgsBase {
+class MOZ_STACK_CLASS MOZ_NON_PARAM CallArgsBase {
static_assert(std::is_same_v<WantUsedRval, IncludeUsedRval> ||
std::is_same_v<WantUsedRval, NoUsedRval>,
"WantUsedRval can only be IncludeUsedRval or NoUsedRval");
@@ -294,7 +294,7 @@ class MOZ_STACK_CLASS CallArgsBase {
} // namespace detail
-class MOZ_STACK_CLASS CallArgs
+class MOZ_STACK_CLASS MOZ_NON_PARAM CallArgs
: public detail::CallArgsBase<detail::IncludeUsedRval> {
private:
friend CallArgs CallArgsFromVp(unsigned argc, Value* vp);
@@ -315,6 +315,9 @@ class MOZ_STACK_CLASS CallArgs
for (unsigned i = 0; i < argc; ++i) {
AssertValueIsNotGray(argv[i]);
}
+ if (constructing) {
+ AssertValueIsNotGray(args.newTarget());
+ }
#endif
return args;
}