Commit graph

12 commits

Author SHA1 Message Date
Delan Azabani
557ce73f5f add spec issue as todo in [[OwnPropertyKeys]] trap 2023-03-23 19:15:20 +08:00
Delan Azabani
c831a136b2 clarify and test interactions with indexed access 2023-03-23 18:07:50 +08:00
Delan Azabani
b1f78d8a3d fix attrs in descriptor for @@toStringTag property 2023-03-23 18:07:44 +08:00
Delan Azabani
dd905d8434 clean up spurious changes and todos with no action needed 2023-03-23 18:07:39 +08:00
Delan Azabani
65da7b668b clean up lints and tidy errors 2023-03-23 18:07:36 +08:00
Delan Azabani
9a8a5bdbf7 make ownPropertyKeys trap return @@toStringTag key
This fixes the failures in the “[[OwnPropertyKeys]]” subtest.
2023-03-23 18:07:11 +08:00
Delan Azabani
bbaacb7b2d make getOwnPropertyDescriptor trap accept @@toStringTag key
This fixes the failures in the “[[Get]]” and “[[Delete]]” subtests.
2023-03-23 18:07:08 +08:00
Delan Azabani
33387eb75a make getOwnPropertyDescriptor trap accept integer indices
Several /webidl/ecmascript-binding/window-named-properties-object.html
subtests, including the “[[GetOwnProperty]]” and “[[HasProperty]]”
subtests, expect iframe.contentWindow.Window.prototype[0] to return an
element with id “0”.

This commit makes the getOwnPropertyDescriptor trap accept property
keys that are integer indices, by converting them to a DOMString just
like we would for a property key that is a JSString.
2023-03-23 18:07:05 +08:00
Delan Azabani
9a3d6969c9 migrate use of deprecated RUST_JS_{IS,TO}_STRING 2023-03-23 18:07:02 +08:00
Delan Azabani
8814e4bb4f fix failures in [[DefineOwnProperty]] subtest
Calling throw_type_error in the [[DefineOwnProperty]] trap (and
returning false) makes the internal method throw a TypeError, which
means both Object#defineProperty and Reflect#defineProperty will throw
a TypeError, but we actually want the latter to return false.

This commit makes the trap set ObjectOpResult to a TypeError (and
return true), making the internal method return false per the spec [1]
and in turn allowing Reflect#defineProperty to return false.

[1] https://webidl.spec.whatwg.org/#named-properties-object-defineownproperty
2023-03-23 18:06:58 +08:00
Delan Azabani
4c7f198ee2 apply yvt/servo/fix-named-window-getter 2023-03-23 18:02:35 +08:00
Delan Azabani
fd1de05592 apply pylbrecht/servo/named.window.getter (closes #27952) 2023-03-23 18:01:26 +08:00