diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 64c9f678e5..c47c95b67c 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -2490,8 +2490,6 @@ private: virtual JS::ThrowCompletionOr internal_set_prototype_of(JS::Object* prototype) override; virtual JS::ThrowCompletionOr internal_prevent_extensions() override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - JS::Realm& m_realm; // [[Realm]] }; )~~~"); @@ -2511,7 +2509,7 @@ static void generate_named_properties_object_definitions(IDL::Interface const& i #include @named_properties_class@::@named_properties_class@(JS::Realm& realm) - : JS::Object(realm, nullptr) + : JS::Object(realm, nullptr, MayInterfereWithIndexedPropertyAccess::Yes) , m_realm(realm) { } diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp index af794c7522..49eb944a63 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp @@ -11,7 +11,7 @@ namespace JS { ArgumentsObject::ArgumentsObject(Realm& realm, Environment& environment) - : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) + : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype(), MayInterfereWithIndexedPropertyAccess::Yes) , m_environment(environment) { } diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h index 7b9e3f0e63..ebb70e4486 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h @@ -27,8 +27,6 @@ public: virtual ThrowCompletionOr internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override; virtual ThrowCompletionOr internal_delete(PropertyKey const&) override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - // [[ParameterMap]] Object& parameter_map() { return *m_parameter_map; } diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp index 65a842cb6a..3a5507d2cb 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp @@ -13,13 +13,13 @@ namespace JS { -FunctionObject::FunctionObject(Realm& realm, Object* prototype) - : Object(realm, prototype) +FunctionObject::FunctionObject(Realm& realm, Object* prototype, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : Object(realm, prototype, may_interfere_with_indexed_property_access) { } -FunctionObject::FunctionObject(Object& prototype) - : Object(ConstructWithPrototypeTag::Tag, prototype) +FunctionObject::FunctionObject(Object& prototype, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : Object(ConstructWithPrototypeTag::Tag, prototype, may_interfere_with_indexed_property_access) { } diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.h b/Userland/Libraries/LibJS/Runtime/FunctionObject.h index 5434da637e..baacfd006a 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.h @@ -41,8 +41,8 @@ public: virtual Vector const& local_variables_names() const { VERIFY_NOT_REACHED(); } protected: - explicit FunctionObject(Realm&, Object* prototype); - explicit FunctionObject(Object& prototype); + explicit FunctionObject(Realm&, Object* prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); + explicit FunctionObject(Object& prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); private: virtual bool is_function() const override { return true; } diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp index 390209971a..f8d3d7185d 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp @@ -11,7 +11,7 @@ namespace JS { ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector exports) - : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) + : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype(), MayInterfereWithIndexedPropertyAccess::Yes) , m_module(module) , m_exports(move(exports)) { diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h index 25e4d0eb49..86288d4d4b 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h @@ -31,8 +31,6 @@ public: virtual ThrowCompletionOr> internal_own_property_keys() const override; virtual void initialize(Realm&) override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - private: ModuleNamespaceObject(Realm&, Module* module, Vector exports); diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index dc2b98b384..52ac334bdd 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -35,18 +35,21 @@ NonnullGCPtr Object::create(Realm& realm, Object* prototype) return realm.heap().allocate(realm, ConstructWithPrototypeTag::Tag, *prototype); } -Object::Object(GlobalObjectTag, Realm& realm) +Object::Object(GlobalObjectTag, Realm& realm, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : m_may_interfere_with_indexed_property_access(may_interfere_with_indexed_property_access == MayInterfereWithIndexedPropertyAccess::Yes) { // This is the global object m_shape = heap().allocate_without_realm(realm); } -Object::Object(ConstructWithoutPrototypeTag, Realm& realm) +Object::Object(ConstructWithoutPrototypeTag, Realm& realm, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : m_may_interfere_with_indexed_property_access(may_interfere_with_indexed_property_access == MayInterfereWithIndexedPropertyAccess::Yes) { m_shape = heap().allocate_without_realm(realm); } -Object::Object(Realm& realm, Object* prototype) +Object::Object(Realm& realm, Object* prototype, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : m_may_interfere_with_indexed_property_access(may_interfere_with_indexed_property_access == MayInterfereWithIndexedPropertyAccess::Yes) { m_shape = realm.intrinsics().empty_object_shape(); VERIFY(m_shape); @@ -54,15 +57,17 @@ Object::Object(Realm& realm, Object* prototype) set_prototype(prototype); } -Object::Object(ConstructWithPrototypeTag, Object& prototype) +Object::Object(ConstructWithPrototypeTag, Object& prototype, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : m_may_interfere_with_indexed_property_access(may_interfere_with_indexed_property_access == MayInterfereWithIndexedPropertyAccess::Yes) { m_shape = prototype.shape().realm().intrinsics().empty_object_shape(); VERIFY(m_shape); set_prototype(&prototype); } -Object::Object(Shape& shape) - : m_shape(&shape) +Object::Object(Shape& shape, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : m_may_interfere_with_indexed_property_access(may_interfere_with_indexed_property_access == MayInterfereWithIndexedPropertyAccess::Yes) + , m_shape(&shape) { m_storage.resize(shape.property_count()); } diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index f6a79f572d..7f5ad6e732 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -76,6 +76,11 @@ public: Yes, }; + enum class MayInterfereWithIndexedPropertyAccess { + No, + Yes, + }; + // Please DO NOT make up your own non-standard methods unless you // have a very good reason to do so. If any object abstract // operation from the spec is missing, add it instead. @@ -139,7 +144,7 @@ public: // to customize access to indexed properties (properties where the name is a positive integer) // must return true for this, to opt out of optimizations that rely on assumptions that // might not hold when property access behaves differently. - virtual bool may_interfere_with_indexed_property_access() const { return false; } + bool may_interfere_with_indexed_property_access() const { return m_may_interfere_with_indexed_property_access; } ThrowCompletionOr ordinary_set_with_own_descriptor(PropertyKey const&, Value, Value, Optional, CacheablePropertyMetadata* = nullptr); @@ -218,11 +223,11 @@ protected: enum class ConstructWithoutPrototypeTag { Tag }; enum class ConstructWithPrototypeTag { Tag }; - Object(GlobalObjectTag, Realm&); - Object(ConstructWithoutPrototypeTag, Realm&); - Object(Realm&, Object* prototype); - Object(ConstructWithPrototypeTag, Object& prototype); - explicit Object(Shape&); + Object(GlobalObjectTag, Realm&, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); + Object(ConstructWithoutPrototypeTag, Realm&, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); + Object(Realm&, Object* prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); + Object(ConstructWithPrototypeTag, Object& prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); + explicit Object(Shape&, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); // [[Extensible]] bool m_is_extensible { true }; @@ -236,6 +241,8 @@ private: Object* prototype() { return shape().prototype(); } Object const* prototype() const { return shape().prototype(); } + bool m_may_interfere_with_indexed_property_access { false }; + // True if this object has lazily allocated intrinsic properties. bool m_has_intrinsic_accessors { false }; diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp index 8d1133a8f2..6d537b93da 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -22,7 +22,7 @@ NonnullGCPtr ProxyObject::create(Realm& realm, Object& target, Obje } ProxyObject::ProxyObject(Object& target, Object& handler, Object& prototype) - : FunctionObject(prototype) + : FunctionObject(prototype, MayInterfereWithIndexedPropertyAccess::Yes) , m_target(target) , m_handler(handler) { diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.h b/Userland/Libraries/LibJS/Runtime/ProxyObject.h index 2b9c44be25..2669b74ee6 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.h +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.h @@ -45,8 +45,6 @@ public: virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) override; virtual ThrowCompletionOr> internal_construct(MarkedVector arguments_list, FunctionObject& new_target) override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - private: ProxyObject(Object& target, Object& handler, Object& prototype); diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.cpp b/Userland/Libraries/LibJS/Runtime/StringObject.cpp index 0e9c74fce4..f74fb19067 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringObject.cpp @@ -30,7 +30,7 @@ NonnullGCPtr StringObject::create(Realm& realm, PrimitiveString& p } StringObject::StringObject(PrimitiveString& string, Object& prototype) - : Object(ConstructWithPrototypeTag::Tag, prototype) + : Object(ConstructWithPrototypeTag::Tag, prototype, MayInterfereWithIndexedPropertyAccess::Yes) , m_string(string) { } diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.h b/Userland/Libraries/LibJS/Runtime/StringObject.h index 3dab8b8f92..9be24bcea0 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.h +++ b/Userland/Libraries/LibJS/Runtime/StringObject.h @@ -30,8 +30,6 @@ private: virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; virtual ThrowCompletionOr> internal_own_property_keys() const override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - virtual bool is_string_object() const final { return true; } virtual void visit_edges(Visitor&) override; diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp index 24a8255899..76bb15398a 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp @@ -459,7 +459,7 @@ void TypedArrayBase::visit_edges(Visitor& visitor) } \ \ PrototypeName::PrototypeName(Object& prototype) \ - : Object(ConstructWithPrototypeTag::Tag, prototype) \ + : Object(ConstructWithPrototypeTag::Tag, prototype, MayInterfereWithIndexedPropertyAccess::Yes) \ { \ } \ \ diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.h b/Userland/Libraries/LibJS/Runtime/TypedArray.h index 0ec9cfffeb..50c1a5e3eb 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.h @@ -62,7 +62,7 @@ public: protected: TypedArrayBase(Object& prototype, IntrinsicConstructor intrinsic_constructor) - : Object(ConstructWithPrototypeTag::Tag, prototype) + : Object(ConstructWithPrototypeTag::Tag, prototype, MayInterfereWithIndexedPropertyAccess::Yes) , m_intrinsic_constructor(intrinsic_constructor) { } @@ -414,8 +414,6 @@ public: return { move(keys) }; } - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - ReadonlySpan data() const { return { reinterpret_cast(m_viewed_array_buffer->buffer().data() + m_byte_offset), m_array_length }; diff --git a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp index f10d750baa..7cbdaa849a 100644 --- a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp @@ -12,7 +12,7 @@ namespace Web::Bindings { LegacyPlatformObject::LegacyPlatformObject(JS::Realm& realm) - : PlatformObject(realm) + : PlatformObject(realm, MayInterfereWithIndexedPropertyAccess::Yes) { } diff --git a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h index 1feb19ab9f..ec0f028909 100644 --- a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h +++ b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h @@ -29,8 +29,6 @@ public: virtual JS::ThrowCompletionOr internal_prevent_extensions() override; virtual JS::ThrowCompletionOr> internal_own_property_keys() const override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - enum class IgnoreNamedProps { No, Yes, diff --git a/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp b/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp index 9b00217cc7..f5ac4c747b 100644 --- a/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp @@ -11,13 +11,13 @@ namespace Web::Bindings { -PlatformObject::PlatformObject(JS::Realm& realm) - : JS::Object(realm, nullptr) +PlatformObject::PlatformObject(JS::Realm& realm, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : JS::Object(realm, nullptr, may_interfere_with_indexed_property_access) { } -PlatformObject::PlatformObject(JS::Object& prototype) - : JS::Object(ConstructWithPrototypeTag::Tag, prototype) +PlatformObject::PlatformObject(JS::Object& prototype, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : JS::Object(ConstructWithPrototypeTag::Tag, prototype, may_interfere_with_indexed_property_access) { } diff --git a/Userland/Libraries/LibWeb/Bindings/PlatformObject.h b/Userland/Libraries/LibWeb/Bindings/PlatformObject.h index fa135cb107..5e855376d8 100644 --- a/Userland/Libraries/LibWeb/Bindings/PlatformObject.h +++ b/Userland/Libraries/LibWeb/Bindings/PlatformObject.h @@ -40,8 +40,8 @@ public: [[nodiscard]] virtual bool implements_interface(DeprecatedString const&) const { return false; } protected: - explicit PlatformObject(JS::Realm&); - explicit PlatformObject(JS::Object& prototype); + explicit PlatformObject(JS::Realm&, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); + explicit PlatformObject(JS::Object& prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); }; } diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp index dc999602ce..aaf5548b7c 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp @@ -38,8 +38,8 @@ namespace Web::DOM { -EventTarget::EventTarget(JS::Realm& realm) - : PlatformObject(realm) +EventTarget::EventTarget(JS::Realm& realm, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access) + : PlatformObject(realm, may_interfere_with_indexed_property_access) { } diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.h b/Userland/Libraries/LibWeb/DOM/EventTarget.h index 233c622746..efb85e27d9 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.h +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.h @@ -59,7 +59,7 @@ public: bool has_event_listeners() const; protected: - explicit EventTarget(JS::Realm&); + explicit EventTarget(JS::Realm&, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); void element_event_handler_attribute_changed(FlyString const& local_name, Optional const& value); diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp b/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp index b7416fba21..1c1124339d 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp +++ b/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp @@ -14,7 +14,7 @@ namespace Web::HTML { AudioTrackList::AudioTrackList(JS::Realm& realm) - : DOM::EventTarget(realm) + : DOM::EventTarget(realm, MayInterfereWithIndexedPropertyAccess::Yes) , m_audio_tracks(realm.heap()) { } diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrackList.h b/Userland/Libraries/LibWeb/HTML/AudioTrackList.h index 14a69b5b0d..f52c8d53ff 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrackList.h +++ b/Userland/Libraries/LibWeb/HTML/AudioTrackList.h @@ -51,8 +51,6 @@ private: virtual void initialize(JS::Realm&) override; virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const& property_name) const override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - JS::MarkedVector> m_audio_tracks; }; diff --git a/Userland/Libraries/LibWeb/HTML/Location.cpp b/Userland/Libraries/LibWeb/HTML/Location.cpp index 822c7e0fa7..927ded2612 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.cpp +++ b/Userland/Libraries/LibWeb/HTML/Location.cpp @@ -24,7 +24,7 @@ namespace Web::HTML { // https://html.spec.whatwg.org/multipage/history.html#the-location-interface Location::Location(JS::Realm& realm) - : PlatformObject(realm) + : PlatformObject(realm, MayInterfereWithIndexedPropertyAccess::Yes) { } diff --git a/Userland/Libraries/LibWeb/HTML/Location.h b/Userland/Libraries/LibWeb/HTML/Location.h index ce769a017c..19667aba6e 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.h +++ b/Userland/Libraries/LibWeb/HTML/Location.h @@ -64,8 +64,6 @@ public: virtual JS::ThrowCompletionOr internal_delete(JS::PropertyKey const&) override; virtual JS::ThrowCompletionOr> internal_own_property_keys() const override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - HTML::CrossOriginPropertyDescriptorMap const& cross_origin_property_descriptor_map() const { return m_cross_origin_property_descriptor_map; } HTML::CrossOriginPropertyDescriptorMap& cross_origin_property_descriptor_map() { return m_cross_origin_property_descriptor_map; } diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp b/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp index 605ce24a41..c75b0f6730 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp +++ b/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp @@ -14,7 +14,7 @@ namespace Web::HTML { VideoTrackList::VideoTrackList(JS::Realm& realm) - : DOM::EventTarget(realm) + : DOM::EventTarget(realm, MayInterfereWithIndexedPropertyAccess::Yes) , m_video_tracks(realm.heap()) { } diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrackList.h b/Userland/Libraries/LibWeb/HTML/VideoTrackList.h index 964b5dbc4a..f0d12ce755 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrackList.h +++ b/Userland/Libraries/LibWeb/HTML/VideoTrackList.h @@ -44,8 +44,6 @@ private: virtual void initialize(JS::Realm&) override; virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const& property_name) const override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - JS::MarkedVector> m_video_tracks; }; diff --git a/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp b/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp index 443a2f2ab1..ecc67412f6 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp +++ b/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp @@ -22,7 +22,7 @@ namespace Web::HTML { // 7.4 The WindowProxy exotic object, https://html.spec.whatwg.org/multipage/window-object.html#the-windowproxy-exotic-object WindowProxy::WindowProxy(JS::Realm& realm) - : JS::Object(realm, nullptr) + : JS::Object(realm, nullptr, MayInterfereWithIndexedPropertyAccess::Yes) { } diff --git a/Userland/Libraries/LibWeb/HTML/WindowProxy.h b/Userland/Libraries/LibWeb/HTML/WindowProxy.h index 20ba10b742..7865a17a3c 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowProxy.h +++ b/Userland/Libraries/LibWeb/HTML/WindowProxy.h @@ -31,8 +31,6 @@ public: virtual JS::ThrowCompletionOr internal_delete(JS::PropertyKey const&) override; virtual JS::ThrowCompletionOr> internal_own_property_keys() const override; - virtual bool may_interfere_with_indexed_property_access() const final { return true; } - JS::GCPtr window() const { return m_window; } void set_window(JS::NonnullGCPtr);