Skip to content

Commit a9673c8

Browse files
committed
Check ignoreNamedProps before the named property visibility algorithm.
Running the named property visibility algorithm is (or should be) observable by inserting a proxy in the prototype chain. This changes the spec to match Gecko's behavior.
1 parent 81dc040 commit a9673c8

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

index.bs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12741,30 +12741,31 @@ internal method as follows.
1274112741
1. Set |desc|.\[[Enumerable]] and |desc|.\[[Configurable]] to <emu-val>true</emu-val>.
1274212742
1. Return |desc|.
1274312743
1. Set |ignoreNamedProps| to true.
12744-
1. If |O| [=support named properties|supports named properties=],
12745-
the result of running the [=named property visibility algorithm=] with
12746-
property name |P| and object |O| is true, and |ignoreNamedProps| is false, then:
12747-
1. Let |operation| be the operation used to declare the named property getter.
12748-
1. Let |value| be an uninitialized variable.
12749-
1. If |operation| was defined without an [=identifier=], then
12750-
set |value| to the result of performing the steps listed in the interface description to
12751-
[=determine the value of a named property=]
12752-
with |P| as the name.
12753-
1. Otherwise, |operation| was defined with an identifier. Set |value| to the result
12754-
of performing the steps listed in the description of |operation| with |P| as the only argument value.
12755-
1. Let |desc| be a newly created [=Property Descriptor=] with no fields.
12756-
1. Set |desc|.\[[Value]] to the result of [=converted to an ECMAScript value|converting=]
12757-
|value| to an ECMAScript value.
12758-
1. If |O| implements an interface with a [=named property setter=], then set
12759-
|desc|.\[[Writable]] to <emu-val>true</emu-val>, otherwise set it to
12760-
<emu-val>false</emu-val>.
12761-
1. If |O| implements an interface with the
12762-
[{{LegacyUnenumerableNamedProperties}}]
12763-
[=extended attribute=],
12764-
then set |desc|.\[[Enumerable]] to <emu-val>false</emu-val>,
12765-
otherwise set it to <emu-val>true</emu-val>.
12766-
1. Set |desc|.\[[Configurable]] to <emu-val>true</emu-val>.
12767-
1. Return |desc|.
12744+
1. If |O| [=support named properties|supports named properties=] and
12745+
|ignoreNamedProps| is false, then:
12746+
1. If the result of running the [=named property visibility algorithm=] with
12747+
property name |P| and object |O| is true, then:
12748+
1. Let |operation| be the operation used to declare the named property getter.
12749+
1. Let |value| be an uninitialized variable.
12750+
1. If |operation| was defined without an [=identifier=], then
12751+
set |value| to the result of performing the steps listed in the interface description to
12752+
[=determine the value of a named property=]
12753+
with |P| as the name.
12754+
1. Otherwise, |operation| was defined with an identifier. Set |value| to the result
12755+
of performing the steps listed in the description of |operation| with |P| as the only argument value.
12756+
1. Let |desc| be a newly created [=Property Descriptor=] with no fields.
12757+
1. Set |desc|.\[[Value]] to the result of [=converted to an ECMAScript value|converting=]
12758+
|value| to an ECMAScript value.
12759+
1. If |O| implements an interface with a [=named property setter=], then set
12760+
|desc|.\[[Writable]] to <emu-val>true</emu-val>, otherwise set it to
12761+
<emu-val>false</emu-val>.
12762+
1. If |O| implements an interface with the
12763+
[{{LegacyUnenumerableNamedProperties}}]
12764+
[=extended attribute=],
12765+
then set |desc|.\[[Enumerable]] to <emu-val>false</emu-val>,
12766+
otherwise set it to <emu-val>true</emu-val>.
12767+
1. Set |desc|.\[[Configurable]] to <emu-val>true</emu-val>.
12768+
1. Return |desc|.
1276812769
1. Return <a abstract-op>OrdinaryGetOwnProperty</a>(|O|, |P|).
1276912770
</div>
1277012771

0 commit comments

Comments
 (0)