diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /js/public/Class.h | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/public/Class.h')
-rw-r--r-- | js/public/Class.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/js/public/Class.h b/js/public/Class.h index 5664198584..0c9833cbcf 100644 --- a/js/public/Class.h +++ b/js/public/Class.h @@ -272,6 +272,9 @@ typedef JSString* (*JSFunToStringOp)(JSContext* cx, JS::HandleObject obj, * JS looks for a property in an object, and if not found, tries to resolve * the given id. *resolvedp should be set to true iff the property was defined * on |obj|. + * + * See JS::dbg::ShouldAvoidSideEffects in Debug.h if this function has any + * other side-effect than just resolving the property. */ typedef bool (*JSResolveOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool* resolvedp); @@ -606,6 +609,10 @@ struct MOZ_STATIC_CLASS JSClassOps { static constexpr const JSClassOps* JS_NULL_CLASS_OPS = nullptr; +// Note: This is a MOZ_STATIC_CLASS, as having a non-static JSClass +// can lead to bizarre behaviour, however the annotation +// is at the bottom to handle some incompatibility with GCC +// annotation processing. struct alignas(js::gc::JSClassAlignBytes) JSClass { const char* name; uint32_t flags; @@ -763,7 +770,7 @@ struct alignas(js::gc::JSClassAlignBytes) JSClass { JSFunToStringOp getOpsFunToString() const { return oOps ? oOps->funToString : nullptr; } -}; +} MOZ_STATIC_CLASS; static constexpr uint32_t JSCLASS_RESERVED_SLOTS(const JSClass* clasp) { return (clasp->flags >> JSCLASS_RESERVED_SLOTS_SHIFT) & |