diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 68ac11575d125c2730accc7b9d138b5d982b8c82..00d45fbf1fad0e263371eed440adcc0425f6989b 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -156,7 +156,7 @@ public: }; // 14.13 Labelled Statements, https://tc39.es/ecma262/#sec-labelled-statements -class LabelledStatement : public Statement { +class LabelledStatement final : public Statement { public: LabelledStatement(SourceRange source_range, DeprecatedFlyString label, NonnullRefPtr labelled_item) : Statement(move(source_range)) diff --git a/Userland/Libraries/LibJS/CyclicModule.h b/Userland/Libraries/LibJS/CyclicModule.h index 06d2a3f32d6f9e7817b1f3a278f6a42473f16ab5..55ce09ffdcf987847ac41e57eb4631ca7cbb49de 100644 --- a/Userland/Libraries/LibJS/CyclicModule.h +++ b/Userland/Libraries/LibJS/CyclicModule.h @@ -27,8 +27,8 @@ class CyclicModule : public Module { public: // Note: Do not call these methods directly unless you are HostResolveImportedModule. // Badges cannot be used because other hosts must be able to call this (and it is called recursively) - virtual ThrowCompletionOr link(VM& vm) override; - virtual ThrowCompletionOr evaluate(VM& vm) override; + virtual ThrowCompletionOr link(VM& vm) override final; + virtual ThrowCompletionOr evaluate(VM& vm) override final; Vector const& requested_modules() const { return m_requested_modules; } @@ -37,8 +37,8 @@ protected: virtual void visit_edges(Cell::Visitor&) override; - virtual ThrowCompletionOr inner_module_linking(VM& vm, Vector& stack, u32 index) override; - virtual ThrowCompletionOr inner_module_evaluation(VM& vm, Vector& stack, u32 index) override; + virtual ThrowCompletionOr inner_module_linking(VM& vm, Vector& stack, u32 index) override final; + virtual ThrowCompletionOr inner_module_evaluation(VM& vm, Vector& stack, u32 index) override final; virtual ThrowCompletionOr initialize_environment(VM& vm); virtual ThrowCompletionOr execute_module(VM& vm, GCPtr capability = {}); diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h index 46f0bffa5ada1e4ebb98f919e1bcf637287d78c8..e7fe042b874f9e521c762a6f73dda78394adcbb5 100644 --- a/Userland/Libraries/LibJS/Heap/Cell.h +++ b/Userland/Libraries/LibJS/Heap/Cell.h @@ -87,7 +87,6 @@ public: virtual ~Visitor() = default; }; - virtual bool is_environment() const { return false; } virtual void visit_edges(Visitor&) { } // This will be called on unmarked objects by the garbage collector in a separate pass before destruction. diff --git a/Userland/Libraries/LibJS/Heap/MarkedVector.h b/Userland/Libraries/LibJS/Heap/MarkedVector.h index 8710c326894e487e45719434e7e3e7beef4a97b9..3a28d8462bab1f3cc957431346643184a8af3f38 100644 --- a/Userland/Libraries/LibJS/Heap/MarkedVector.h +++ b/Userland/Libraries/LibJS/Heap/MarkedVector.h @@ -33,7 +33,7 @@ public: }; template -class MarkedVector +class MarkedVector final : public MarkedVectorBase , public Vector { diff --git a/Userland/Libraries/LibJS/Runtime/Array.h b/Userland/Libraries/LibJS/Runtime/Array.h index 4b010a461524d282ea1bea7067053f147fc65214..9da03e401e2dada6dbae2399fe59080236dc127c 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.h +++ b/Userland/Libraries/LibJS/Runtime/Array.h @@ -40,10 +40,10 @@ public: virtual ~Array() override = default; - virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const override; - virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; - virtual ThrowCompletionOr internal_delete(PropertyKey const&) override; - virtual ThrowCompletionOr> internal_own_property_keys() const override; + virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const override final; + virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override final; + virtual ThrowCompletionOr internal_delete(PropertyKey const&) override final; + virtual ThrowCompletionOr> internal_own_property_keys() const override final; [[nodiscard]] bool length_is_writable() const { return m_length_writable; } diff --git a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h index f03aabc057e0ee06654de877042c271deba5c645..b167deb7b19afdf86a9ff74a815b522a8c1ac98e 100644 --- a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h @@ -32,11 +32,11 @@ public: virtual ~DeclarativeEnvironment() override = default; - virtual ThrowCompletionOr has_binding(DeprecatedFlyString const& name, Optional* = nullptr) const override; - virtual ThrowCompletionOr create_mutable_binding(VM&, DeprecatedFlyString const& name, bool can_be_deleted) override; - virtual ThrowCompletionOr create_immutable_binding(VM&, DeprecatedFlyString const& name, bool strict) override; - virtual ThrowCompletionOr initialize_binding(VM&, DeprecatedFlyString const& name, Value, InitializeBindingHint) override; - virtual ThrowCompletionOr set_mutable_binding(VM&, DeprecatedFlyString const& name, Value, bool strict) override; + virtual ThrowCompletionOr has_binding(DeprecatedFlyString const& name, Optional* = nullptr) const override final; + virtual ThrowCompletionOr create_mutable_binding(VM&, DeprecatedFlyString const& name, bool can_be_deleted) override final; + virtual ThrowCompletionOr create_immutable_binding(VM&, DeprecatedFlyString const& name, bool strict) override final; + virtual ThrowCompletionOr initialize_binding(VM&, DeprecatedFlyString const& name, Value, InitializeBindingHint) override final; + virtual ThrowCompletionOr set_mutable_binding(VM&, DeprecatedFlyString const& name, Value, bool strict) override final; virtual ThrowCompletionOr get_binding_value(VM&, DeprecatedFlyString const& name, bool strict) override; virtual ThrowCompletionOr delete_binding(VM&, DeprecatedFlyString const& name) override; diff --git a/Userland/Libraries/LibJS/Runtime/Environment.h b/Userland/Libraries/LibJS/Runtime/Environment.h index f79dc9f18315ab35c25b6a0e57eb9604b38cd0be..480057abca1e183c2e6b6493afda6d7c8df373c3 100644 --- a/Userland/Libraries/LibJS/Runtime/Environment.h +++ b/Userland/Libraries/LibJS/Runtime/Environment.h @@ -63,8 +63,6 @@ protected: virtual void visit_edges(Visitor&) override; private: - virtual bool is_environment() const final { return true; } - bool m_permanently_screwed_by_eval { false }; GCPtr m_outer_environment; diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index ce55de9e5975f333b27315a29b5396587e74db86..b414c6b64a37bd610567fc53c3cbf01bd5d091e0 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -164,7 +164,7 @@ public: void define_direct_accessor(PropertyKey const&, FunctionObject* getter, FunctionObject* setter, PropertyAttributes attributes); using IntrinsicAccessor = Value (*)(Realm&); - virtual void define_intrinsic_accessor(PropertyKey const&, PropertyAttributes attributes, IntrinsicAccessor accessor); + void define_intrinsic_accessor(PropertyKey const&, PropertyAttributes attributes, IntrinsicAccessor accessor); void define_native_function(Realm&, PropertyKey const&, SafeFunction(VM&)>, i32 length, PropertyAttributes attributes); void define_native_accessor(Realm&, PropertyKey const&, SafeFunction(VM&)> getter, SafeFunction(VM&)> setter, PropertyAttributes attributes); diff --git a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h index cc5d600b28447d4f3cb20e93547ece4d36980bad..f38fdd75d651c5984331261085c0c23feb398547 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h @@ -10,7 +10,7 @@ namespace JS { -class ObjectEnvironment : public Environment { +class ObjectEnvironment final : public Environment { JS_ENVIRONMENT(ObjectEnvironment, Environment); public: