diff options
author | davidot <david.tuin@gmail.com> | 2021-06-26 12:41:37 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-26 18:16:53 +0100 |
commit | 83dd0164b2df8e13cb80a1fa8cda46001113122c (patch) | |
tree | 51436bab09a75ec7c250491322b217eebb3f33e0 /Userland/Libraries/LibJS | |
parent | 19f505d32012928edc27856345f068e5122e3e5b (diff) | |
download | serenity-83dd0164b2df8e13cb80a1fa8cda46001113122c.zip |
Revert "LibJS: Fix this_value in native setters and getters"
This reverts commit f102b563
The reverted to behavior is not correct for example with a double proxy
But this change lead to problems with DOMNodes
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Object.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 7bc5a56952..b0dd99ba16 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -278,7 +278,7 @@ Value Object::get_own_property(const PropertyName& property_name, Value receiver if (value_here.is_accessor()) return value_here.as_accessor().call_getter(receiver); if (value_here.is_native_property()) - return call_native_property_getter(value_here.as_native_property(), this); + return call_native_property_getter(value_here.as_native_property(), receiver); } return value_here; } @@ -940,7 +940,9 @@ bool Object::put_by_index(u32 property_index, Value value) return true; } if (value_here.value.is_native_property()) { - call_native_property_setter(value_here.value.as_native_property(), this, value); + // FIXME: Why doesn't put_by_index() receive the receiver value from put()?! + auto receiver = this; + call_native_property_setter(value_here.value.as_native_property(), receiver, value); return true; } } @@ -977,7 +979,7 @@ bool Object::put(const PropertyName& property_name, Value value, Value receiver) return true; } if (value_here.is_native_property()) { - call_native_property_setter(value_here.as_native_property(), this, value); + call_native_property_setter(value_here.as_native_property(), receiver, value); return true; } } |