diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 527cccec6a..bee0d5134f 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -3011,7 +3011,7 @@ public: JS::Realm& realm() const { return m_realm; } private: virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const&) const override; - virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&) override; + virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual JS::ThrowCompletionOr internal_delete(JS::PropertyKey const&) override; virtual JS::ThrowCompletionOr internal_set_prototype_of(JS::Object* prototype) override; virtual JS::ThrowCompletionOr internal_prevent_extensions() override; @@ -3129,7 +3129,7 @@ JS::ThrowCompletionOr> @named_properties_class@ } // https://webidl.spec.whatwg.org/#named-properties-object-defineownproperty -JS::ThrowCompletionOr @named_properties_class@::internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&) +JS::ThrowCompletionOr @named_properties_class@::internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional*) { // 1. Return false. return false; diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp index d9178c997f..9bef49e222 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp @@ -127,7 +127,7 @@ ThrowCompletionOr> ArgumentsObject::internal_get_ow } // 10.4.4.2 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-arguments-exotic-objects-defineownproperty-p-desc -ThrowCompletionOr ArgumentsObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& descriptor) +ThrowCompletionOr ArgumentsObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& descriptor, Optional* precomputed_get_own_property) { // 1. Let map be args.[[ParameterMap]]. auto& map = parameter_map(); @@ -150,7 +150,7 @@ ThrowCompletionOr ArgumentsObject::internal_define_own_property(PropertyKe } // 5. Let allowed be ! OrdinaryDefineOwnProperty(args, P, newArgDesc). - bool allowed = MUST(Object::internal_define_own_property(property_key, new_arg_desc)); + bool allowed = MUST(Object::internal_define_own_property(property_key, new_arg_desc, precomputed_get_own_property)); // 6. If allowed is false, return false. if (!allowed) diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h index 2bee162eb1..be27a62e1e 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h @@ -23,7 +23,7 @@ public: Environment& environment() { return m_environment; } virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const override; - virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; + virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual ThrowCompletionOr internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) const override; virtual ThrowCompletionOr internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override; virtual ThrowCompletionOr internal_delete(PropertyKey const&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Array.cpp b/Userland/Libraries/LibJS/Runtime/Array.cpp index 6c7bf32702..635e42e8c4 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.cpp +++ b/Userland/Libraries/LibJS/Runtime/Array.cpp @@ -277,7 +277,7 @@ ThrowCompletionOr> Array::internal_get_own_property } // 10.4.2.1 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-array-exotic-objects-defineownproperty-p-desc -ThrowCompletionOr Array::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor) +ThrowCompletionOr Array::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor, Optional* precomputed_get_own_property) { auto& vm = this->vm(); @@ -303,7 +303,7 @@ ThrowCompletionOr Array::internal_define_own_property(PropertyKey const& p return false; // h. Let succeeded be ! OrdinaryDefineOwnProperty(A, P, Desc). - auto succeeded = MUST(Object::internal_define_own_property(property_key, property_descriptor)); + auto succeeded = MUST(Object::internal_define_own_property(property_key, property_descriptor, precomputed_get_own_property)); // i. If succeeded is false, return false. if (!succeeded) @@ -319,7 +319,7 @@ ThrowCompletionOr Array::internal_define_own_property(PropertyKey const& p } // 3. Return ? OrdinaryDefineOwnProperty(A, P, Desc). - return Object::internal_define_own_property(property_key, property_descriptor); + return Object::internal_define_own_property(property_key, property_descriptor, precomputed_get_own_property); } // NON-STANDARD: Used to reject deletes to ephemeral (non-configurable) length property diff --git a/Userland/Libraries/LibJS/Runtime/Array.h b/Userland/Libraries/LibJS/Runtime/Array.h index a55a2a634d..75ce47ae71 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.h +++ b/Userland/Libraries/LibJS/Runtime/Array.h @@ -48,7 +48,7 @@ public: virtual ~Array() override = default; 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_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override final; virtual ThrowCompletionOr internal_delete(PropertyKey const&) override; virtual ThrowCompletionOr> internal_own_property_keys() const override final; diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp index e9a7c0786e..69e9cde9c1 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp @@ -82,11 +82,11 @@ ThrowCompletionOr> ModuleNamespaceObject::internal_ } // 10.4.6.6 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-defineownproperty-p-desc -ThrowCompletionOr ModuleNamespaceObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& descriptor) +ThrowCompletionOr ModuleNamespaceObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& descriptor, Optional* precomputed_get_own_property) { // 1. If Type(P) is Symbol, return ! OrdinaryDefineOwnProperty(O, P, Desc). if (property_key.is_symbol()) - return MUST(Object::internal_define_own_property(property_key, descriptor)); + return MUST(Object::internal_define_own_property(property_key, descriptor, precomputed_get_own_property)); // 2. Let current be ? O.[[GetOwnProperty]](P). auto current = TRY(internal_get_own_property(property_key)); diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h index 9c211aec77..be38f93471 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h @@ -24,7 +24,7 @@ public: virtual ThrowCompletionOr internal_is_extensible() const override; virtual ThrowCompletionOr internal_prevent_extensions() override; virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const override; - virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; + virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual ThrowCompletionOr internal_has_property(PropertyKey const&) const override; virtual ThrowCompletionOr internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata* = nullptr, PropertyLookupPhase = PropertyLookupPhase::OwnProperty) const override; virtual ThrowCompletionOr internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override; diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 9c2c9382dc..e22300ed47 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -848,12 +848,12 @@ ThrowCompletionOr> Object::internal_get_own_propert } // 10.1.6 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc -ThrowCompletionOr Object::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor) +ThrowCompletionOr Object::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor, Optional* precomputed_get_own_property) { VERIFY(property_key.is_valid()); // 1. Let current be ? O.[[GetOwnProperty]](P). - auto current = TRY(internal_get_own_property(property_key)); + auto current = precomputed_get_own_property ? *precomputed_get_own_property : TRY(internal_get_own_property(property_key)); // 2. Let extensible be ? IsExtensible(O). auto extensible = TRY(is_extensible()); @@ -1009,8 +1009,10 @@ ThrowCompletionOr Object::ordinary_set_with_own_descriptor(PropertyKey con if (!receiver.is_object()) return false; + auto& receiver_object = receiver.as_object(); + // c. Let existingDescriptor be ? Receiver.[[GetOwnProperty]](P). - auto existing_descriptor = TRY(receiver.as_object().internal_get_own_property(property_key)); + auto existing_descriptor = TRY(receiver_object.internal_get_own_property(property_key)); // d. If existingDescriptor is not undefined, then if (existing_descriptor.has_value()) { @@ -1034,15 +1036,15 @@ ThrowCompletionOr Object::ordinary_set_with_own_descriptor(PropertyKey con } // iv. Return ? Receiver.[[DefineOwnProperty]](P, valueDesc). - return TRY(receiver.as_object().internal_define_own_property(property_key, value_descriptor)); + return TRY(receiver_object.internal_define_own_property(property_key, value_descriptor, &existing_descriptor)); } // e. Else, else { // i. Assert: Receiver does not currently have a property P. - VERIFY(!receiver.as_object().storage_has(property_key)); + VERIFY(!receiver_object.storage_has(property_key)); // ii. Return ? CreateDataProperty(Receiver, P, V). - return TRY(receiver.as_object().create_data_property(property_key, value)); + return TRY(receiver_object.create_data_property(property_key, value)); } } diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index ae3fbd1a0a..3459cfcbef 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -138,7 +138,7 @@ public: virtual ThrowCompletionOr internal_is_extensible() const; virtual ThrowCompletionOr internal_prevent_extensions(); virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const; - virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&); + virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr); virtual ThrowCompletionOr internal_has_property(PropertyKey const&) const; enum class PropertyLookupPhase { OwnProperty, diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp index c511d9289c..af5c5b6299 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -336,7 +336,7 @@ ThrowCompletionOr> ProxyObject::internal_get_own_pr } // 10.5.6 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc -ThrowCompletionOr ProxyObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor) +ThrowCompletionOr ProxyObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor, Optional*) { LIMIT_PROXY_RECURSION_DEPTH(); diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.h b/Userland/Libraries/LibJS/Runtime/ProxyObject.h index 9452ae3dd1..d2f21d910c 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.h +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.h @@ -37,7 +37,7 @@ public: virtual ThrowCompletionOr internal_is_extensible() const override; virtual ThrowCompletionOr internal_prevent_extensions() override; virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const override; - virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; + virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual ThrowCompletionOr internal_has_property(PropertyKey const&) const override; virtual ThrowCompletionOr internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) const override; virtual ThrowCompletionOr internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override; diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.cpp b/Userland/Libraries/LibJS/Runtime/StringObject.cpp index 3600ac5953..e127e8500c 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringObject.cpp @@ -113,7 +113,7 @@ ThrowCompletionOr> StringObject::internal_get_own_p } // 10.4.3.2 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-string-exotic-objects-defineownproperty-p-desc -ThrowCompletionOr StringObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor) +ThrowCompletionOr StringObject::internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor, Optional* precomputed_get_own_property) { VERIFY(property_key.is_valid()); @@ -130,7 +130,7 @@ ThrowCompletionOr StringObject::internal_define_own_property(PropertyKey c } // 3. Return ! OrdinaryDefineOwnProperty(S, P, Desc). - return Object::internal_define_own_property(property_key, property_descriptor); + return Object::internal_define_own_property(property_key, property_descriptor, precomputed_get_own_property); } // 10.4.3.3 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-string-exotic-objects-ownpropertykeys diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.h b/Userland/Libraries/LibJS/Runtime/StringObject.h index a979c5274b..a0fe580713 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.h +++ b/Userland/Libraries/LibJS/Runtime/StringObject.h @@ -28,7 +28,7 @@ protected: private: virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const override; - virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; + virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual ThrowCompletionOr> internal_own_property_keys() const override; virtual bool is_string_object() const final { return true; } diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.h b/Userland/Libraries/LibJS/Runtime/TypedArray.h index 10195b7342..6eea597cad 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.h @@ -268,7 +268,7 @@ public: } // 10.4.5.3 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-defineownproperty-p-desc - virtual ThrowCompletionOr internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor) override + virtual ThrowCompletionOr internal_define_own_property(PropertyKey const& property_key, PropertyDescriptor const& property_descriptor, Optional* precomputed_get_own_property = nullptr) override { VERIFY(property_key.is_valid()); @@ -313,7 +313,7 @@ public: } // 2. Return ! OrdinaryDefineOwnProperty(O, P, Desc). - return Object::internal_define_own_property(property_key, property_descriptor); + return Object::internal_define_own_property(property_key, property_descriptor, precomputed_get_own_property); } // 10.4.5.4 [[Get]] ( P, Receiver ), 10.4.5.4 [[Get]] ( P, Receiver ) diff --git a/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp b/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp index 5d510ef04e..dd98562184 100644 --- a/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp @@ -253,10 +253,12 @@ JS::ThrowCompletionOr PlatformObject::internal_set(JS::PropertyKey const& } // https://webidl.spec.whatwg.org/#legacy-platform-object-defineownproperty -JS::ThrowCompletionOr PlatformObject::internal_define_own_property(JS::PropertyKey const& property_name, JS::PropertyDescriptor const& property_descriptor) +JS::ThrowCompletionOr PlatformObject::internal_define_own_property(JS::PropertyKey const& property_name, JS::PropertyDescriptor const& property_descriptor, Optional* precomputed_get_own_property) { + Optional get_own_property_result = {}; + if (!m_legacy_platform_object_flags.has_value() || m_legacy_platform_object_flags->has_global_interface_extended_attribute) - return Base::internal_define_own_property(property_name, property_descriptor); + return Base::internal_define_own_property(property_name, property_descriptor, precomputed_get_own_property); auto& vm = this->vm(); @@ -287,7 +289,14 @@ JS::ThrowCompletionOr PlatformObject::internal_define_own_property(JS::Pro // 2. If O implements an interface with the [LegacyOverrideBuiltIns] extended attribute or O does not have an own property named P, then: // NOTE: Own property lookup has to be done manually instead of using Object::has_own_property, as that would use the overridden internal_get_own_property. - if (m_legacy_platform_object_flags->has_legacy_override_built_ins_interface_extended_attribute || !TRY(Object::internal_get_own_property(property_name)).has_value()) { + if (!m_legacy_platform_object_flags->has_legacy_override_built_ins_interface_extended_attribute) { + // AD-HOC: Avoid computing the [[GetOwnProperty]] multiple times. + if (!precomputed_get_own_property) { + get_own_property_result = TRY(Object::internal_get_own_property(property_name)); + precomputed_get_own_property = &get_own_property_result; + } + } + if (m_legacy_platform_object_flags->has_legacy_override_built_ins_interface_extended_attribute || precomputed_get_own_property->has_value()) { // 1. If creating is false and O does not implement an interface with a named property setter, then return false. if (!creating && !m_legacy_platform_object_flags->has_named_property_setter) return false; @@ -308,7 +317,7 @@ JS::ThrowCompletionOr PlatformObject::internal_define_own_property(JS::Pro } // 3. Return ! OrdinaryDefineOwnProperty(O, P, Desc). - return Object::internal_define_own_property(property_name, property_descriptor); + return Object::internal_define_own_property(property_name, property_descriptor, precomputed_get_own_property); } // https://webidl.spec.whatwg.org/#legacy-platform-object-delete diff --git a/Userland/Libraries/LibWeb/Bindings/PlatformObject.h b/Userland/Libraries/LibWeb/Bindings/PlatformObject.h index d17ea33b09..a416236071 100644 --- a/Userland/Libraries/LibWeb/Bindings/PlatformObject.h +++ b/Userland/Libraries/LibWeb/Bindings/PlatformObject.h @@ -37,7 +37,7 @@ public: // ^JS::Object virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const&) const override; virtual JS::ThrowCompletionOr internal_set(JS::PropertyKey const&, JS::Value, JS::Value, JS::CacheablePropertyMetadata* = nullptr) override; - virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&) override; + virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual JS::ThrowCompletionOr internal_delete(JS::PropertyKey const&) override; virtual JS::ThrowCompletionOr internal_prevent_extensions() override; virtual JS::ThrowCompletionOr> internal_own_property_keys() const override; diff --git a/Userland/Libraries/LibWeb/HTML/Location.cpp b/Userland/Libraries/LibWeb/HTML/Location.cpp index d0998b3236..52816e547c 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.cpp +++ b/Userland/Libraries/LibWeb/HTML/Location.cpp @@ -528,13 +528,13 @@ JS::ThrowCompletionOr> Location::internal_get_o } // 7.10.5.6 [[DefineOwnProperty]] ( P, Desc ), https://html.spec.whatwg.org/multipage/history.html#location-defineownproperty -JS::ThrowCompletionOr Location::internal_define_own_property(JS::PropertyKey const& property_key, JS::PropertyDescriptor const& descriptor) +JS::ThrowCompletionOr Location::internal_define_own_property(JS::PropertyKey const& property_key, JS::PropertyDescriptor const& descriptor, Optional* precomputed_get_own_property) { // 1. If IsPlatformObjectSameOrigin(this) is true, then: if (HTML::is_platform_object_same_origin(*this)) { // 1. If the value of the [[DefaultProperties]] internal slot of this contains P, then return false. // 2. Return ? OrdinaryDefineOwnProperty(this, P, Desc). - return JS::Object::internal_define_own_property(property_key, descriptor); + return JS::Object::internal_define_own_property(property_key, descriptor, precomputed_get_own_property); } // 2. Throw a "SecurityError" DOMException. diff --git a/Userland/Libraries/LibWeb/HTML/Location.h b/Userland/Libraries/LibWeb/HTML/Location.h index f82f63d53a..5c04da0307 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.h +++ b/Userland/Libraries/LibWeb/HTML/Location.h @@ -59,7 +59,7 @@ public: virtual JS::ThrowCompletionOr internal_is_extensible() const override; virtual JS::ThrowCompletionOr internal_prevent_extensions() override; virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const&) const override; - virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&) override; + virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual JS::ThrowCompletionOr internal_get(JS::PropertyKey const&, JS::Value receiver, JS::CacheablePropertyMetadata*, PropertyLookupPhase) const override; virtual JS::ThrowCompletionOr internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) override; virtual JS::ThrowCompletionOr internal_delete(JS::PropertyKey const&) override; diff --git a/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp b/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp index a6c60d9eda..438d96e289 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp +++ b/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp @@ -133,7 +133,7 @@ JS::ThrowCompletionOr> WindowProxy::internal_ge } // 7.4.6 [[DefineOwnProperty]] ( P, Desc ), https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-defineownproperty -JS::ThrowCompletionOr WindowProxy::internal_define_own_property(JS::PropertyKey const& property_key, JS::PropertyDescriptor const& descriptor) +JS::ThrowCompletionOr WindowProxy::internal_define_own_property(JS::PropertyKey const& property_key, JS::PropertyDescriptor const& descriptor, Optional*) { // 1. Let W be the value of the [[Window]] internal slot of this. diff --git a/Userland/Libraries/LibWeb/HTML/WindowProxy.h b/Userland/Libraries/LibWeb/HTML/WindowProxy.h index faa17594cc..86e72b18e4 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowProxy.h +++ b/Userland/Libraries/LibWeb/HTML/WindowProxy.h @@ -26,7 +26,7 @@ public: virtual JS::ThrowCompletionOr internal_is_extensible() const override; virtual JS::ThrowCompletionOr internal_prevent_extensions() override; virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const&) const override; - virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&) override; + virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional* precomputed_get_own_property = nullptr) override; virtual JS::ThrowCompletionOr internal_get(JS::PropertyKey const&, JS::Value receiver, JS::CacheablePropertyMetadata*, PropertyLookupPhase) const override; virtual JS::ThrowCompletionOr internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) override; virtual JS::ThrowCompletionOr internal_delete(JS::PropertyKey const&) override;