diff options
Diffstat (limited to 'js/src/frontend/EmitterScope.h')
-rw-r--r-- | js/src/frontend/EmitterScope.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/js/src/frontend/EmitterScope.h b/js/src/frontend/EmitterScope.h index c7dfd1d559..9498cc1b38 100644 --- a/js/src/frontend/EmitterScope.h +++ b/js/src/frontend/EmitterScope.h @@ -56,16 +56,16 @@ class EmitterScope : public Nestable<EmitterScope> // block scope note list. Otherwise ScopeNote::NoScopeNote. uint32_t noteIndex_; - MOZ_MUST_USE bool ensureCache(BytecodeEmitter* bce); + [[nodiscard]] bool ensureCache(BytecodeEmitter* bce); template <typename BindingIter> - MOZ_MUST_USE bool checkSlotLimits(BytecodeEmitter* bce, const BindingIter& bi); + [[nodiscard]] bool checkSlotLimits(BytecodeEmitter* bce, const BindingIter& bi); - MOZ_MUST_USE bool checkEnvironmentChainLength(BytecodeEmitter* bce); + [[nodiscard]] bool checkEnvironmentChainLength(BytecodeEmitter* bce); void updateFrameFixedSlots(BytecodeEmitter* bce, const BindingIter& bi); - MOZ_MUST_USE bool putNameInCache(BytecodeEmitter* bce, JSAtom* name, NameLocation loc); + [[nodiscard]] bool putNameInCache(BytecodeEmitter* bce, JSAtom* name, NameLocation loc); mozilla::Maybe<NameLocation> lookupInCache(BytecodeEmitter* bce, JSAtom* name); @@ -79,12 +79,12 @@ class EmitterScope : public Nestable<EmitterScope> NameLocation searchAndCache(BytecodeEmitter* bce, JSAtom* name); template <typename ScopeCreator> - MOZ_MUST_USE bool internScope(BytecodeEmitter* bce, ScopeCreator createScope); + [[nodiscard]] bool internScope(BytecodeEmitter* bce, ScopeCreator createScope); template <typename ScopeCreator> - MOZ_MUST_USE bool internBodyScope(BytecodeEmitter* bce, ScopeCreator createScope); - MOZ_MUST_USE bool appendScopeNote(BytecodeEmitter* bce); + [[nodiscard]] bool internBodyScope(BytecodeEmitter* bce, ScopeCreator createScope); + [[nodiscard]] bool appendScopeNote(BytecodeEmitter* bce); - MOZ_MUST_USE bool deadZoneFrameSlotRange(BytecodeEmitter* bce, uint32_t slotStart, + [[nodiscard]] bool deadZoneFrameSlotRange(BytecodeEmitter* bce, uint32_t slotStart, uint32_t slotEnd) const; public: @@ -92,21 +92,21 @@ class EmitterScope : public Nestable<EmitterScope> void dump(BytecodeEmitter* bce); - MOZ_MUST_USE bool enterLexical(BytecodeEmitter* bce, ScopeKind kind, + [[nodiscard]] bool enterLexical(BytecodeEmitter* bce, ScopeKind kind, Handle<LexicalScope::Data*> bindings); - MOZ_MUST_USE bool enterNamedLambda(BytecodeEmitter* bce, FunctionBox* funbox); - MOZ_MUST_USE bool enterComprehensionFor(BytecodeEmitter* bce, + [[nodiscard]] bool enterNamedLambda(BytecodeEmitter* bce, FunctionBox* funbox); + [[nodiscard]] bool enterComprehensionFor(BytecodeEmitter* bce, Handle<LexicalScope::Data*> bindings); - MOZ_MUST_USE bool enterFunction(BytecodeEmitter* bce, FunctionBox* funbox); - MOZ_MUST_USE bool enterFunctionExtraBodyVar(BytecodeEmitter* bce, FunctionBox* funbox); - MOZ_MUST_USE bool enterParameterExpressionVar(BytecodeEmitter* bce); - MOZ_MUST_USE bool enterGlobal(BytecodeEmitter* bce, GlobalSharedContext* globalsc); - MOZ_MUST_USE bool enterEval(BytecodeEmitter* bce, EvalSharedContext* evalsc); - MOZ_MUST_USE bool enterModule(BytecodeEmitter* module, ModuleSharedContext* modulesc); - MOZ_MUST_USE bool enterWith(BytecodeEmitter* bce); - MOZ_MUST_USE bool deadZoneFrameSlots(BytecodeEmitter* bce) const; - - MOZ_MUST_USE bool leave(BytecodeEmitter* bce, bool nonLocal = false); + [[nodiscard]] bool enterFunction(BytecodeEmitter* bce, FunctionBox* funbox); + [[nodiscard]] bool enterFunctionExtraBodyVar(BytecodeEmitter* bce, FunctionBox* funbox); + [[nodiscard]] bool enterParameterExpressionVar(BytecodeEmitter* bce); + [[nodiscard]] bool enterGlobal(BytecodeEmitter* bce, GlobalSharedContext* globalsc); + [[nodiscard]] bool enterEval(BytecodeEmitter* bce, EvalSharedContext* evalsc); + [[nodiscard]] bool enterModule(BytecodeEmitter* module, ModuleSharedContext* modulesc); + [[nodiscard]] bool enterWith(BytecodeEmitter* bce); + [[nodiscard]] bool deadZoneFrameSlots(BytecodeEmitter* bce) const; + + [[nodiscard]] bool leave(BytecodeEmitter* bce, bool nonLocal = false); uint32_t index() const { MOZ_ASSERT(scopeIndex_ != ScopeNote::NoScopeIndex, "Did you forget to intern a Scope?"); |