From a477ba8010fa24d2ae09bc20eac81fd191c90376 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 10 May 2019 17:57:29 +0200 Subject: [PATCH 1/6] Reduce the restrictions on members whose names match auto-generated properties Fixes #49. --- index.bs | 146 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 55 deletions(-) diff --git a/index.bs b/index.bs index 5aba1f92..1e176054 100644 --- a/index.bs +++ b/index.bs @@ -3981,12 +3981,19 @@ the iterator objects returned by entries, keys, values, and {{@@iterator}} are actual [=array iterator objects=]. -Interfaces with iterable declarations must not -have any [=interface members=] -named "entries", "forEach", -"keys", or "values", -or have any [=inherited interfaces=] -that have [=members=] with these names. +Interfaces with iterable declarations must not have any [=regular attributes=] or [=constants=] +named +"entries", +"forEach", +"keys", or +"values", +or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or +[=constants=] with these names. + +Note: Operations with these names are allowed on interfaces with iterable declarations and will +prevent the default implementation of these methods being added to the +[=interface prototype object=] in the ECMAScript language binding. +This allows the default behavior of these operations to be overridden.
@@ -4132,23 +4139,30 @@ keyword is used, this includes entries, For read–write maplikes, it also includes clear, delete, and set methods. -Maplike interfaces must not -have any [=interface members=] -named "entries", "forEach", -"get", "has", -"keys", "size", or +Maplike interfaces must not have any [=regular attributes=] or [=constants=] named +"entries", +"forEach", +"get", +"has", +"keys", +"size", or "values", -or have any [=inherited interfaces=] -that have [=members=] with these names. -Read–write maplike interfaces must not -have any [=attributes=] -or [=constants=] named -"clear", "delete", -or "set", or have any [=inherited interfaces=] -that have [=attributes=] or [=constants=] with these names. - -Note: Operations named "clear", "delete", -or "set" are allowed on read–write maplike +or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or +[=constants=] with these names. + +Maplike interfaces must not have any [=regular operations=] or [=constants=] named +"size", +or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or +[=constants=] with that name. + +Read–write maplike interfaces must not have any [=regular attributes=] or [=constants=] named +"clear", +"delete", or +"set", +or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or +[=constants=] with these names. + +Note: Operations with these names are allowed on maplike interfaces and will prevent the default implementation of these methods being added to the interface prototype object in the ECMAScript language binding. This allows the default behavior of these operations to be overridden. @@ -4226,22 +4240,28 @@ keyword is used, this includes entries, For read–write setlikes, it also includes add, clear, and delete methods. -Setlike interfaces must not -have any [=interface members=] -named "entries", "forEach", -"has", "keys", -"size", or "values", -or have any [=inherited interfaces=] -that have [=members=] with these names. -Read–write setlike interfaces must not -have any [=attributes=] -or [=constants=] named -"add", "clear", -or "delete", or have any [=inherited interfaces=] -that have [=attributes=] or [=constants=] with these names. - -Note: Operations named "add", "clear", -or "delete" are allowed on read–write setlike +Setlike interfaces must not have any [=regular attributes=] or [=constants=] named +"entries", +"forEach", +"has", +"keys", or +"values", +or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or +[=constants=] with these names. + +Setlike interfaces must not have any [=regular operations=] or [=constants=] named +"size", +or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or +[=constants=] with that name. + +Read–write setlike interfaces must not have any [=regular attributes=] or [=constants=] named +"add", +"clear", or +"delete", +or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or +[=constants=] with these names. + +Note: Operations with these names are allowed on setlike interfaces and will prevent the default implementation of these methods being added to the interface prototype object in the ECMAScript language binding. This allows the default behavior of these operations to be overridden. @@ -11579,13 +11599,14 @@ if the interface has a [=setlike declaration=].
forEach
-If the [=interface=] has any of the following: +If the [=interface=] does not declare a [=regular operation=] with [=identifier=] +forEach and has any of the following: * an [=iterable declaration=] * a [=maplike declaration=] * a [=setlike declaration=] -then a forEach data property must exist with attributes +forEach data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. @@ -11683,7 +11704,8 @@ property is the String value "forEach".
entries
-If the [=interface=] has an [=iterable declaration=], +If the [=interface=] does not declare a [=regular operation=] with [=identifier=] +entries and has an [=iterable declaration=], then an entries data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. @@ -11704,7 +11726,8 @@ the value of the {{@@iterator}} property.
keys
-If the [=interface=] has an [=iterable declaration=], +If the [=interface=] does not declare a [=regular operation=] with [=identifier=] +keys and has an [=iterable declaration=], then a keys data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. @@ -11745,8 +11768,8 @@ The value of the [=function object=]’s name property
values
-If the [=interface=] has an -[=iterable declaration=], +If the [=interface=] does not declare a [=regular operation=] with [=identifier=] +values and has an [=iterable declaration=], then a values data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. @@ -11919,7 +11942,8 @@ These additional properties are described in the sub-sections below.
size
-There must exist a size property on +If |A| does not declare a [=regular attribute=] with [=identifier=] +size, there must exist a size property on |A|’s [=interface prototype object=] with the following characteristics: @@ -11950,7 +11974,8 @@ with the following characteristics:
entries
-An entries data property must exist on +If |A| does not declare a [=regular operation=] with [=identifier=] +entries, there must exist an entries property on |A|’s [=interface prototype object=] with attributes { \[[Writable]]: true, \[[Enumerable]]: false, \[[Configurable]]: true } and whose value is the [=function object=] that is the value of @@ -11959,7 +11984,9 @@ the {{@@iterator}} property.
keys and values
-For both of keys and values, there must exist a data property with that name on +For both of keys and values, +if |A| does not declare a [=regular operation=] with that name as its [=identifier=], +there must exist a data property with that name on |A|’s [=interface prototype object=] with the following characteristics: @@ -11973,7 +12000,9 @@ The value of the [=function object=]’s name property
get and has
-For both of get and has, there must exist a data property with that name on +For both of get and has, +if |A| does not declare a [=regular operation=] with that name as its [=identifier=], +there must exist a data property with that name on |A|’s [=interface prototype object=] with the following characteristics: * The property has attributes @@ -12007,7 +12036,7 @@ The value of the [=function object=]’s name property
clear
-If |A| does not declare a [=member=] +If |A| does not declare a [=regular operation=] with identifier "clear", and |A| was declared with a read–write maplike declaration, then a clear data property with the following characteristics @@ -12024,7 +12053,7 @@ The value of the [=function object=]’s name property
delete
-If |A| does not declare a [=member=] +If |A| does not declare a [=regular operation=] with identifier "delete", and |A| was declared with a read–write maplike declaration, then a delete data property with the following characteristics @@ -12059,7 +12088,7 @@ The value of the [=function object=]’s name property
set
-If |A| does not declare a [=member=] with identifier "set", +If |A| does not declare a [=regular operation=] with identifier "set", and |A| was declared with a read–write maplike declaration, then a set data property with the following characteristics must exist on |A|’s [=interface prototype object=]: @@ -12136,7 +12165,9 @@ These additional properties are described in the sub-sections below.
size
-A size property must exist on |A|’s [=interface prototype object=] +If |A| does not declare a [=regular attribute=] with [=identifier=] +size, there must exist a size property on +|A|’s [=interface prototype object=] with the following characteristics: * The property has attributes { \[[Get]]: |G|, \[[Enumerable]]: false, \[[Configurable]]: true }, @@ -12165,7 +12196,8 @@ with the following characteristics:
values
-A values data property must exist on |A|’s [=interface prototype object=] +If |A| does not declare a [=regular operation=] with [=identifier=] +values, there must exist an values property on with attributes { \[[Writable]]: true, \[[Enumerable]]: false, \[[Configurable]]: true } and whose value is the [=function object=] that is the value of the {{@@iterator}} property. @@ -12173,7 +12205,9 @@ the {{@@iterator}} property.
entries and keys
-For both of entries and keys, there must exist a data property with that name on +For both of entries and keys, +if |A| does not declare a [=regular operation=] with that name as its [=identifier=], +there must exist a data property with that name on |A|’s [=interface prototype object=] with the following characteristics: * The property has attributes @@ -12190,7 +12224,9 @@ the String value "entries" or "keys", correspondingly.
has
-There must exist a has data property on |A|’s [=interface prototype object=] +If |A| does not declare a [=regular operation=] with [=identifier=] +has, there must exist an has property on +|A|’s [=interface prototype object=] with the following characteristics: * The property has attributes From 74dddeb4b0fdf79643a4eb30d808af4819044948 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 13 May 2019 10:36:40 +0200 Subject: [PATCH 2/6] fixup! Reduce the restrictions on members whose names match auto-generated properties --- index.bs | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/index.bs b/index.bs index 1e176054..e0f5eeb7 100644 --- a/index.bs +++ b/index.bs @@ -3981,19 +3981,12 @@ the iterator objects returned by entries, keys, values, and {{@@iterator}} are actual [=array iterator objects=]. -Interfaces with iterable declarations must not have any [=regular attributes=] or [=constants=] -named +Interfaces with iterable declarations and their [=inherited interfaces=] must not have any +[=regular operations=], [=regular attributes=] or [=constants=] named "entries", "forEach", "keys", or -"values", -or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or -[=constants=] with these names. - -Note: Operations with these names are allowed on interfaces with iterable declarations and will -prevent the default implementation of these methods being added to the -[=interface prototype object=] in the ECMAScript language binding. -This allows the default behavior of these operations to be overridden. +"values".
@@ -4139,7 +4132,8 @@ keyword is used, this includes entries, For read–write maplikes, it also includes clear, delete, and set methods. -Maplike interfaces must not have any [=regular attributes=] or [=constants=] named +Maplike interfaces and their [=inherited interfaces=] must not have any [=regular operations=], +[=regular attributes=] or [=constants=] named "entries", "forEach", "get", @@ -4150,11 +4144,6 @@ Maplike interfaces must not have any [=regular attributes=] or [=constants=] nam or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or [=constants=] with these names. -Maplike interfaces must not have any [=regular operations=] or [=constants=] named -"size", -or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or -[=constants=] with that name. - Read–write maplike interfaces must not have any [=regular attributes=] or [=constants=] named "clear", "delete", or @@ -4162,7 +4151,7 @@ Read–write maplike interfaces must not have any [=regular attributes=] or [=co or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or [=constants=] with these names. -Note: Operations with these names are allowed on maplike +Note: Operations with these names are allowed on read–write maplike interfaces and will prevent the default implementation of these methods being added to the interface prototype object in the ECMAScript language binding. This allows the default behavior of these operations to be overridden. @@ -4240,19 +4229,14 @@ keyword is used, this includes entries, For read–write setlikes, it also includes add, clear, and delete methods. -Setlike interfaces must not have any [=regular attributes=] or [=constants=] named +Setlike interfaces and their [=inherited interfaces=] must not have any [=regular operations=], +[=regular attributes=] or [=constants=] named "entries", "forEach", "has", -"keys", or -"values", -or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or -[=constants=] with these names. - -Setlike interfaces must not have any [=regular operations=] or [=constants=] named -"size", -or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or -[=constants=] with that name. +"keys", +"size", or +"values". Read–write setlike interfaces must not have any [=regular attributes=] or [=constants=] named "add", @@ -4261,7 +4245,7 @@ Read–write setlike interfaces must not have any [=regular attributes=] or [=co or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or [=constants=] with these names. -Note: Operations with these names are allowed on setlike +Note: Operations with these names are allowed on read–write setlike interfaces and will prevent the default implementation of these methods being added to the interface prototype object in the ECMAScript language binding. This allows the default behavior of these operations to be overridden. From d07b4b18a5a6e5d502053c6d72e103a675e7e28b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 13 May 2019 10:48:44 +0200 Subject: [PATCH 3/6] fixup! Reduce the restrictions on members whose names match auto-generated properties --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index e0f5eeb7..9e1386c7 100644 --- a/index.bs +++ b/index.bs @@ -11590,7 +11590,7 @@ If the [=interface=] does not declare a [=regular operation=] with [=identifier= * a [=maplike declaration=] * a [=setlike declaration=] -forEach data property must exist with attributes +then a forEach data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. From d6722f1dc262cfb5f16d6f3c759a84ed34cd9cc8 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 14 May 2019 09:39:55 +0200 Subject: [PATCH 4/6] fixup! Reduce the restrictions on members whose names match auto-generated properties --- index.bs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/index.bs b/index.bs index 9e1386c7..abed151f 100644 --- a/index.bs +++ b/index.bs @@ -4140,9 +4140,7 @@ Maplike interfaces and their [=inherited interfaces=] must not have any [=regula "has", "keys", "size", or -"values", -or have any [=inherited interfaces=] that have [=regular operations=], [=regular attributes=] or -[=constants=] with these names. +"values". Read–write maplike interfaces must not have any [=regular attributes=] or [=constants=] named "clear", @@ -11583,8 +11581,7 @@ if the interface has a [=setlike declaration=].
forEach
-If the [=interface=] does not declare a [=regular operation=] with [=identifier=] -forEach and has any of the following: +If the [=interface=] has any of the following: * an [=iterable declaration=] * a [=maplike declaration=] @@ -12149,9 +12146,7 @@ These additional properties are described in the sub-sections below.
size
-If |A| does not declare a [=regular attribute=] with [=identifier=] -size, there must exist a size property on -|A|’s [=interface prototype object=] +A size property must exist on |A|’s [=interface prototype object=] with the following characteristics: * The property has attributes { \[[Get]]: |G|, \[[Enumerable]]: false, \[[Configurable]]: true }, @@ -12180,8 +12175,7 @@ with the following characteristics:
values
-If |A| does not declare a [=regular operation=] with [=identifier=] -values, there must exist an values property on +A values data property must exist on |A|’s [=interface prototype object=] with attributes { \[[Writable]]: true, \[[Enumerable]]: false, \[[Configurable]]: true } and whose value is the [=function object=] that is the value of the {{@@iterator}} property. @@ -12189,9 +12183,7 @@ the {{@@iterator}} property.
entries and keys
-For both of entries and keys, -if |A| does not declare a [=regular operation=] with that name as its [=identifier=], -there must exist a data property with that name on +For both of entries and keys, there must exist a data property with that name on |A|’s [=interface prototype object=] with the following characteristics: * The property has attributes @@ -12208,9 +12200,7 @@ the String value "entries" or "keys", correspondingly.
has
-If |A| does not declare a [=regular operation=] with [=identifier=] -has, there must exist an has property on -|A|’s [=interface prototype object=] +There must exist a has data property on |A|’s [=interface prototype object=] with the following characteristics: * The property has attributes From 5bbed7d121c2dcbb7d4170cdfc4ccd36a1aca00c Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 14 May 2019 12:29:50 +0200 Subject: [PATCH 5/6] fixup! Reduce the restrictions on members whose names match auto-generated properties --- index.bs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/index.bs b/index.bs index abed151f..d3bab0d0 100644 --- a/index.bs +++ b/index.bs @@ -11685,8 +11685,7 @@ property is the String value "forEach".
entries
-If the [=interface=] does not declare a [=regular operation=] with [=identifier=] -entries and has an [=iterable declaration=], +If the [=interface=] has an [=iterable declaration=], then an entries data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. @@ -11707,8 +11706,7 @@ the value of the {{@@iterator}} property.
keys
-If the [=interface=] does not declare a [=regular operation=] with [=identifier=] -keys and has an [=iterable declaration=], +If the [=interface=] has an [=iterable declaration=], then a keys data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. @@ -11749,8 +11747,8 @@ The value of the [=function object=]’s name property
values
-If the [=interface=] does not declare a [=regular operation=] with [=identifier=] -values and has an [=iterable declaration=], +If the [=interface=] has an +[=iterable declaration=], then a values data property must exist with attributes { \[[Writable]]: true, \[[Enumerable]]: true, \[[Configurable]]: true } and whose value is a [=function object=]. @@ -11923,8 +11921,7 @@ These additional properties are described in the sub-sections below.
size
-If |A| does not declare a [=regular attribute=] with [=identifier=] -size, there must exist a size property on +There must exist a size property on |A|’s [=interface prototype object=] with the following characteristics: @@ -11955,8 +11952,7 @@ with the following characteristics:
entries
-If |A| does not declare a [=regular operation=] with [=identifier=] -entries, there must exist an entries property on +An entries data property must exist on |A|’s [=interface prototype object=] with attributes { \[[Writable]]: true, \[[Enumerable]]: false, \[[Configurable]]: true } and whose value is the [=function object=] that is the value of @@ -11965,9 +11961,7 @@ the {{@@iterator}} property.
keys and values
-For both of keys and values, -if |A| does not declare a [=regular operation=] with that name as its [=identifier=], -there must exist a data property with that name on +For both of keys and values, there must exist a data property with that name on |A|’s [=interface prototype object=] with the following characteristics: @@ -11981,9 +11975,7 @@ The value of the [=function object=]’s name property
get and has
-For both of get and has, -if |A| does not declare a [=regular operation=] with that name as its [=identifier=], -there must exist a data property with that name on +For both of get and has, there must exist a data property with that name on |A|’s [=interface prototype object=] with the following characteristics: * The property has attributes From 164a960feddb1f5ba0b135a4ce4b165671cac355 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 16 May 2019 11:38:32 +0200 Subject: [PATCH 6/6] fixup! Reduce the restrictions on members whose names match auto-generated properties --- index.bs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index d3bab0d0..51d357d2 100644 --- a/index.bs +++ b/index.bs @@ -3981,8 +3981,9 @@ the iterator objects returned by entries, keys, values, and {{@@iterator}} are actual [=array iterator objects=]. -Interfaces with iterable declarations and their [=inherited interfaces=] must not have any -[=regular operations=], [=regular attributes=] or [=constants=] named +Interfaces with iterable declarations, their [=inherited interfaces=], and any [=interfaces=] that +[=interface/inherit=] from them must not have any [=regular operations=], [=regular attributes=] or +[=constants=] named "entries", "forEach", "keys", or @@ -4132,8 +4133,9 @@ keyword is used, this includes entries, For read–write maplikes, it also includes clear, delete, and set methods. -Maplike interfaces and their [=inherited interfaces=] must not have any [=regular operations=], -[=regular attributes=] or [=constants=] named +Maplike interfaces, their [=inherited interfaces=], and any [=interfaces=] that +[=interface/inherit=] from them must not have any [=regular operations=], [=regular attributes=] or +[=constants=] named "entries", "forEach", "get", @@ -4227,8 +4229,9 @@ keyword is used, this includes entries, For read–write setlikes, it also includes add, clear, and delete methods. -Setlike interfaces and their [=inherited interfaces=] must not have any [=regular operations=], -[=regular attributes=] or [=constants=] named +Setlike interfaces, their [=inherited interfaces=], and any [=interfaces=] that +[=interface/inherit=] from them must not have any [=regular operations=], [=regular attributes=] or +[=constants=] named "entries", "forEach", "has",