mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS+LibWeb: Prevent double invocation of [[GetOwnProperty]]
The `[[GetOwnProperty]]` internal method invocation in `OrdinarySetWithOwnDescriptor` was being invocated again with the same parameters in the `[[DefineOwnProperty]]` internal method that is also later called in `OrdinarySetWithOwnDescriptor`. The `PlatformObject.[[DefineOwnProperty]]` has similair logic. This change adds an optional parameter to the `[[DefineOwnProperty]]` internal method so the results of the previous `[[GetOwnProperty]]` internal method invocation can be re-used.
This commit is contained in:
parent
641c549463
commit
69f96122b6
Notes:
github-actions[bot]
2024-11-02 11:27:54 +00:00
Author: https://github.com/yyny
Commit: 69f96122b6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2114
20 changed files with 47 additions and 36 deletions
|
@ -3011,7 +3011,7 @@ public:
|
|||
JS::Realm& realm() const { return m_realm; }
|
||||
private:
|
||||
virtual JS::ThrowCompletionOr<Optional<JS::PropertyDescriptor>> internal_get_own_property(JS::PropertyKey const&) const override;
|
||||
virtual JS::ThrowCompletionOr<bool> internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&) override;
|
||||
virtual JS::ThrowCompletionOr<bool> internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional<JS::PropertyDescriptor>* precomputed_get_own_property = nullptr) override;
|
||||
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
|
||||
virtual JS::ThrowCompletionOr<bool> internal_set_prototype_of(JS::Object* prototype) override;
|
||||
virtual JS::ThrowCompletionOr<bool> internal_prevent_extensions() override;
|
||||
|
@ -3129,7 +3129,7 @@ JS::ThrowCompletionOr<Optional<JS::PropertyDescriptor>> @named_properties_class@
|
|||
}
|
||||
|
||||
// https://webidl.spec.whatwg.org/#named-properties-object-defineownproperty
|
||||
JS::ThrowCompletionOr<bool> @named_properties_class@::internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&)
|
||||
JS::ThrowCompletionOr<bool> @named_properties_class@::internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional<JS::PropertyDescriptor>*)
|
||||
{
|
||||
// 1. Return false.
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue