diff options
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) & |