Skip to content

Commit 10a2e88

Browse files
authored
Allow static operations with the same names as default operations
Now also for Maplike/Setlike/Iterable/AsyncIterable. Fixes #1280.
1 parent 8813044 commit 10a2e88

File tree

1 file changed

+32
-37
lines changed

1 file changed

+32
-37
lines changed

index.bs

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec: ecmascript; type: dfn;
1616
for: ECMAScript;
1717
text: constructor
1818
text: realm
19+
spec: dom; type: dfn; text: element
1920
</pre>
2021

2122
<pre class="anchors">
@@ -3936,12 +3937,10 @@ the iterator objects returned by <code class="idl">entries</code>,
39363937
<code class="idl">keys</code>, <code class="idl">values</code>, and {{@@iterator}} are
39373938
actual [=array iterator objects=].
39383939

3939-
Interfaces with iterable declarations must not
3940-
have any [=interface members=]
3941-
named "<code>entries</code>", "<code>forEach</code>",
3942-
"<code>keys</code>", or "<code>values</code>",
3943-
or have any [=inherited interfaces=]
3944-
that have [=members=] with these names.
3940+
[=Interfaces=] with an [=iterable declaration=] must not have any [=attributes=], [=constants=], or
3941+
[=regular operations=] named "<code>entries</code>", "<code>forEach</code>", "<code>keys</code>", or
3942+
"<code>values</code>", or have any [=inherited interfaces=] that have [=attributes=], [=constants=],
3943+
or [=regular operations=] with these names.
39453944

39463945
<div class="example" id="example-d2254660">
39473946

@@ -4124,9 +4123,10 @@ The prose may also define <dfn export>asynchronous iterator initialization steps
41244123
receive the instance of the [=interface=] being iterated, the newly-created iterator object, and a
41254124
[=list=] of IDL values representing the arguments passed, if any.
41264125

4127-
[=Interfaces=] with an [=asynchronously iterable declaration=] must not have any
4128-
[=interface members=] named "<code>entries</code>", "<code>keys</code>", or "<code>values</code>",
4129-
or have any [=inherited interfaces=] that have [=interface members=] with these names.
4126+
[=Interfaces=] with an [=asynchronously iterable declaration=] must not have any [=attributes=],
4127+
[=constants=], or [=regular operations=] named "<code>entries</code>", "<code>keys</code>", or
4128+
"<code>values</code>", or have any [=inherited interfaces=] that have [=attributes=], [=constants=],
4129+
or [=regular operations=] with these names.
41304130

41314131
<div class="example" id="example-69bd6dcd">
41324132

@@ -4282,14 +4282,11 @@ keyword is used, this includes <code class="idl">entries</code>,
42824282
For read–write maplikes, it also includes <code class="idl">clear</code>,
42834283
<code class="idl">delete</code>, and <code class="idl">set</code> methods.
42844284

4285-
Maplike interfaces must not
4286-
have any [=interface members=]
4287-
named "<code>entries</code>", "<code>forEach</code>",
4288-
"<code>get</code>", "<code>has</code>",
4289-
"<code>keys</code>", "<code>size</code>", or
4290-
"<code>values</code>",
4291-
or have any [=inherited interfaces=]
4292-
that have [=members=] with these names.
4285+
Maplike interfaces must not have any [=attributes=], [=constants=], or [=regular operations=] named
4286+
"<code>entries</code>", "<code>forEach</code>", "<code>get</code>", "<code>has</code>",
4287+
"<code>keys</code>", "<code>size</code>", or "<code>values</code>", or have any
4288+
[=inherited interfaces=] that have [=attributes=], [=constants=], or [=regular operations=] with
4289+
these names.
42934290

42944291
Read–write maplike interfaces must not
42954292
have any [=attributes=]
@@ -4298,12 +4295,11 @@ or [=constants=] named
42984295
or "<code>set</code>", or have any [=inherited interfaces=]
42994296
that have [=attributes=] or [=constants=] with these names.
43004297

4301-
Note: Read-write maplike interfaces <em>can</em> have <em>operations</em>
4302-
named "<code>clear</code>", "<code>delete</code>", or "<code>set</code>",
4303-
which will override the default implementation of those methods
4304-
(defined in [[#es-maplike]]). If such operations are defined, they must
4305-
match the input and output expectations of each method, defined in their
4306-
default implementation sections.
4298+
Note: Read-write maplike interfaces <em>can</em> have <em>regular operations</em> named
4299+
"<code>clear</code>", "<code>delete</code>", or "<code>set</code>", which will override the default
4300+
implementation of those methods (defined in [[#es-maplike]]). If such regular operations are
4301+
defined, they must match the input and output expectations of each method, defined in their default
4302+
implementation sections.
43074303

43084304
An interface must not have more than one
43094305
[=maplike declaration=].
@@ -4376,24 +4372,23 @@ keyword is used, this includes <code class="idl">entries</code>,
43764372
For read–write setlikes, it also includes <code class="idl">add</code>,
43774373
<code class="idl">clear</code>, and <code class="idl">delete</code> methods.
43784374

4379-
Setlike interfaces must not
4380-
have any [=interface members=]
4381-
named "<code>entries</code>", "<code>forEach</code>",
4382-
"<code>has</code>", "<code>keys</code>",
4383-
"<code>size</code>", or "<code>values</code>",
4384-
or have any [=inherited interfaces=]
4385-
that have [=members=] with these names.
4375+
Setlike interfaces must not have any [=attributes=], [=constants=], or [=regular operations=] named
4376+
"<code>entries</code>", "<code>forEach</code>", "<code>has</code>", "<code>keys</code>",
4377+
"<code>size</code>", or "<code>values</code>", or have any [=inherited interfaces=] that have
4378+
[=attributes=], [=constants=], or [=regular operations=] with these names.
4379+
43864380
Read–write setlike interfaces must not
43874381
have any [=attributes=]
43884382
or [=constants=] named
43894383
"<code>add</code>", "<code>clear</code>",
43904384
or "<code>delete</code>", or have any [=inherited interfaces=]
43914385
that have [=attributes=] or [=constants=] with these names.
43924386

4393-
Note: Read-write setlike interfaces <em>can</em> have <em>operations</em>
4394-
named "<code>add</code>", "<code>clear</code>", or "<code>delete</code>",
4395-
which will override the default implementation of those methods
4396-
(defined in [[#es-setlike]].)
4387+
Note: Read-write setlike interfaces <em>can</em> have <em>regular operations</em> named
4388+
"<code>add</code>", "<code>clear</code>", or "<code>delete</code>", which will override the default
4389+
implementation of those methods (defined in [[#es-setlike]]). If such regular operations are
4390+
defined, they must match the input and output expectations of each method, defined in their default
4391+
implementation sections.
43974392

43984393
An interface must not have more than one
43994394
[=setlike declaration=].
@@ -7444,7 +7439,7 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
74447439
to an IDL {{ByteString}} value by running the following algorithm:
74457440

74467441
1. Let |x| be [=?=] <a abstract-op>ToString</a>(|V|).
7447-
1. If the value of any [=ECMAScript String/element=]
7442+
1. If the value of any <l spec=ecmascript>[=ECMAScript String/element=]</l>
74487443
of |x| is greater than 255, then [=ECMAScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
74497444
1. Return an IDL {{ByteString}} value
74507445
whose length is the length of |x|, and where the value of each element is
@@ -7456,8 +7451,8 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
74567451
an IDL {{ByteString}} value to an ECMAScript
74577452
value is a String
74587453
value whose length is the length of the {{ByteString}},
7459-
and the value of each [=ECMAScript String/element=] of which is the value of the corresponding element
7460-
of the {{ByteString}}.
7454+
and the value of each <l spec=ecmascript>[=ECMAScript String/element=]</l> of which is the value
7455+
of the corresponding element of the {{ByteString}}.
74617456
</p>
74627457

74637458

0 commit comments

Comments
 (0)