From 34a28299abe335a8d7990b934ad5148675d06674 Mon Sep 17 00:00:00 2001 From: Tab Atkins-Bittner Date: Fri, 29 Apr 2022 13:25:28 -0700 Subject: [PATCH 1/3] Make it clearer that static and namespace attrs don't get to have state. Fixes #1133 --- index.bs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 042bc54a..d6611dc1 100644 --- a/index.bs +++ b/index.bs @@ -11880,7 +11880,6 @@ in which case they are exposed on every object that [=implements=] the interface 1. Let |steps| be the following series of steps: 1. Try running the following steps: - 1. Let |idlObject| be null. 1. If |target| is an [=interface=], and |attribute| is a [=regular attribute=]: 1. Let |esValue| be the this value, if it is not null or undefined, or |realm|'s @@ -11899,8 +11898,16 @@ in which case they are exposed on every object that [=implements=] the interface [=backing observable array exotic object=] for |attribute|. 1. Set |idlObject| to the IDL [=interface type=] value that represents a reference to |esValue|. - 1. Let |R| be the result of running the [=getter steps=] of |attribute| with - |idlObject| as [=this=]. + 1. Let |R| be the result of running the [=getter steps=] of |attribute| with + |idlObject| as [=this=]. + + Otherwise, let |R| be the result of running the [=getter steps=] of |attribute| with + null as [=this=]. + + Note: [=Namespaces=] and [=interface=] objects (themselves, + rather than their instances) are not intended to carry state, + so their attribute getters intentionally do not get access to them. + 1. Return the result of [=converted to an ECMAScript value|converting=] |R| to an ECMAScript value of the type |attribute| is declared as. From 3d8682ffe069a1b321c37cc25a5f80ebbcd1a253 Mon Sep 17 00:00:00 2001 From: Tab Atkins-Bittner Date: Mon, 2 May 2022 11:43:52 -0700 Subject: [PATCH 2/3] Fix the now-first reference to idlObject to use 'let' --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index d6611dc1..2f10d15a 100644 --- a/index.bs +++ b/index.bs @@ -11896,7 +11896,7 @@ in which case they are exposed on every object that [=implements=] the interface 1. Otherwise, [=ECMAScript/throw=] a {{ECMAScript/TypeError}}. 1. If |attribute|'s type is an [=observable array type=], then return |esValue|'s [=backing observable array exotic object=] for |attribute|. - 1. Set |idlObject| to the IDL [=interface type=] value that represents a reference + 1. Let |idlObject| be the IDL [=interface type=] value that represents a reference to |esValue|. 1. Let |R| be the result of running the [=getter steps=] of |attribute| with |idlObject| as [=this=]. From a1a27d8f2f494309aba46b48de7bc306d359e043 Mon Sep 17 00:00:00 2001 From: Tab Atkins-Bittner Date: Mon, 2 May 2022 11:44:54 -0700 Subject: [PATCH 3/3] R needs to be defined in the above the list for scoping reasons --- index.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 2f10d15a..a3a6d88e 100644 --- a/index.bs +++ b/index.bs @@ -11880,7 +11880,8 @@ in which case they are exposed on every object that [=implements=] the interface 1. Let |steps| be the following series of steps: 1. Try running the following steps: - 1. If |target| is an [=interface=], and |attribute| is a [=regular attribute=]: + 1. If |target| is an [=interface=], and |attribute| is a [=regular attribute=], + let |R| initially be undefined and execute the following steps: 1. Let |esValue| be the this value, if it is not null or undefined, or |realm|'s [=Realm/global object=] otherwise. @@ -11898,7 +11899,7 @@ in which case they are exposed on every object that [=implements=] the interface [=backing observable array exotic object=] for |attribute|. 1. Let |idlObject| be the IDL [=interface type=] value that represents a reference to |esValue|. - 1. Let |R| be the result of running the [=getter steps=] of |attribute| with + 1. Set |R| to the result of running the [=getter steps=] of |attribute| with |idlObject| as [=this=]. Otherwise, let |R| be the result of running the [=getter steps=] of |attribute| with