diff options
Diffstat (limited to 'dom/script/ScriptSettings.h')
-rw-r--r-- | dom/script/ScriptSettings.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/dom/script/ScriptSettings.h b/dom/script/ScriptSettings.h index f2e12f0be9..381f923e6e 100644 --- a/dom/script/ScriptSettings.h +++ b/dom/script/ScriptSettings.h @@ -224,11 +224,11 @@ public: // If aGlobalObject represents a web-visible global, errors reported by this // AutoJSAPI as it comes off the stack will fire the relevant error events and // show up in the corresponding web console. - MOZ_MUST_USE bool Init(nsIGlobalObject* aGlobalObject); + [[nodiscard]] bool Init(nsIGlobalObject* aGlobalObject); // This is a helper that grabs the native global associated with aObject and // invokes the above Init() with that. - MOZ_MUST_USE bool Init(JSObject* aObject); + [[nodiscard]] bool Init(JSObject* aObject); // Unsurprisingly, this uses aCx and enters the compartment of aGlobalObject. // If aGlobalObject or its associated JS global are null then it returns @@ -238,15 +238,15 @@ public: // If aGlobalObject represents a web-visible global, errors reported by this // AutoJSAPI as it comes off the stack will fire the relevant error events and // show up in the corresponding web console. - MOZ_MUST_USE bool Init(nsIGlobalObject* aGlobalObject, JSContext* aCx); + [[nodiscard]] bool Init(nsIGlobalObject* aGlobalObject, JSContext* aCx); // Convenience functions to take an nsPIDOMWindow* or nsGlobalWindow*, // when it is more easily available than an nsIGlobalObject. - MOZ_MUST_USE bool Init(nsPIDOMWindowInner* aWindow); - MOZ_MUST_USE bool Init(nsPIDOMWindowInner* aWindow, JSContext* aCx); + [[nodiscard]] bool Init(nsPIDOMWindowInner* aWindow); + [[nodiscard]] bool Init(nsPIDOMWindowInner* aWindow, JSContext* aCx); - MOZ_MUST_USE bool Init(nsGlobalWindow* aWindow); - MOZ_MUST_USE bool Init(nsGlobalWindow* aWindow, JSContext* aCx); + [[nodiscard]] bool Init(nsGlobalWindow* aWindow); + [[nodiscard]] bool Init(nsGlobalWindow* aWindow, JSContext* aCx); JSContext* cx() const { MOZ_ASSERT(mCx, "Must call Init before using an AutoJSAPI"); @@ -272,12 +272,12 @@ public: // // Note that this fails if and only if we OOM while wrapping the exception // into the current compartment. - MOZ_MUST_USE bool StealException(JS::MutableHandle<JS::Value> aVal); + [[nodiscard]] bool StealException(JS::MutableHandle<JS::Value> aVal); // As for StealException(), but put the saved frames for any stack trace // associated with the point the exception was thrown into aStack. // aVal will be in the current compartment, but aStack might not be. - MOZ_MUST_USE bool StealExceptionAndStack(JS::MutableHandle<JS::Value> aVal, + [[nodiscard]] bool StealExceptionAndStack(JS::MutableHandle<JS::Value> aVal, JS::MutableHandle<JSObject*> aStack); // Peek the current exception from the JS engine, without stealing it. @@ -286,7 +286,7 @@ public: // // Note that this fails if and only if we OOM while wrapping the exception // into the current compartment. - MOZ_MUST_USE bool PeekException(JS::MutableHandle<JS::Value> aVal); + [[nodiscard]] bool PeekException(JS::MutableHandle<JS::Value> aVal); void ClearException() { MOZ_ASSERT(IsStackTop()); |