From 4f60f42abdf0f5e60ea0de8739c980b3dc5e432f Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 17 Jan 2019 16:36:46 +0100 Subject: [PATCH] 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. --- index.bs | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/index.bs b/index.bs index 9591f0e5..636ef41b 100644 --- a/index.bs +++ b/index.bs @@ -12741,30 +12741,31 @@ internal method as follows. 1. Set |desc|.\[[Enumerable]] and |desc|.\[[Configurable]] to true. 1. Return |desc|. 1. Set |ignoreNamedProps| to true. - 1. If |O| [=support named properties|supports named properties=], - the result of running the [=named property visibility algorithm=] with - property name |P| and object |O| is true, and |ignoreNamedProps| is false, then: - 1. Let |operation| be the operation used to declare the named property getter. - 1. Let |value| be an uninitialized variable. - 1. If |operation| was defined without an [=identifier=], then - set |value| to the result of performing the steps listed in the interface description to - [=determine the value of a named property=] - with |P| as the name. - 1. Otherwise, |operation| was defined with an identifier. Set |value| to the result - of performing the steps listed in the description of |operation| with |P| as the only argument value. - 1. Let |desc| be a newly created [=Property Descriptor=] with no fields. - 1. Set |desc|.\[[Value]] to the result of [=converted to an ECMAScript value|converting=] - |value| to an ECMAScript value. - 1. If |O| implements an interface with a [=named property setter=], then set - |desc|.\[[Writable]] to true, otherwise set it to - false. - 1. If |O| implements an interface with the - [{{LegacyUnenumerableNamedProperties}}] - [=extended attribute=], - then set |desc|.\[[Enumerable]] to false, - otherwise set it to true. - 1. Set |desc|.\[[Configurable]] to true. - 1. Return |desc|. + 1. If |O| [=support named properties|supports named properties=] and + |ignoreNamedProps| is false, then: + 1. If the result of running the [=named property visibility algorithm=] with + property name |P| and object |O| is true, then: + 1. Let |operation| be the operation used to declare the named property getter. + 1. Let |value| be an uninitialized variable. + 1. If |operation| was defined without an [=identifier=], then + set |value| to the result of performing the steps listed in the interface description to + [=determine the value of a named property=] + with |P| as the name. + 1. Otherwise, |operation| was defined with an identifier. Set |value| to the result + of performing the steps listed in the description of |operation| with |P| as the only argument value. + 1. Let |desc| be a newly created [=Property Descriptor=] with no fields. + 1. Set |desc|.\[[Value]] to the result of [=converted to an ECMAScript value|converting=] + |value| to an ECMAScript value. + 1. If |O| implements an interface with a [=named property setter=], then set + |desc|.\[[Writable]] to true, otherwise set it to + false. + 1. If |O| implements an interface with the + [{{LegacyUnenumerableNamedProperties}}] + [=extended attribute=], + then set |desc|.\[[Enumerable]] to false, + otherwise set it to true. + 1. Set |desc|.\[[Configurable]] to true. + 1. Return |desc|. 1. Return OrdinaryGetOwnProperty(|O|, |P|).