@@ -568,7 +568,6 @@ underscore.
568
568
"inherit"
569
569
"interface"
570
570
"iterable"
571
- "legacycaller"
572
571
"maplike"
573
572
"namespace"
574
573
"partial"
@@ -1950,7 +1949,6 @@ The following extended attributes are applicable to operations:
1950
1949
"getter"
1951
1950
"setter"
1952
1951
"deleter"
1953
- "legacycaller"
1954
1952
</pre>
1955
1953
1956
1954
<pre class="grammar" id="prod-OperationRest">
@@ -2141,11 +2139,6 @@ is used to declare it and what the purpose of the special operation is:
2141
2139
<td><emu-t>deleter</emu-t></td>
2142
2140
<td>Defines behavior for when an object is indexed for property deletion.</td>
2143
2141
</tr>
2144
- <tr>
2145
- <td><dfn id="dfn-legacy-caller" export lt="legacy caller">Legacy callers</dfn></td>
2146
- <td><emu-t>legacycaller</emu-t></td>
2147
- <td>Defines behavior for when an object is called as if it were a function.</td>
2148
- </tr>
2149
2142
<tr>
2150
2143
<td><dfn id="dfn-stringifier" export lt="stringifier">Stringifiers</dfn></td>
2151
2144
<td><emu-t>stringifier</emu-t></td>
@@ -2231,8 +2224,6 @@ there must exist at most one
2231
2224
stringifier, at most one
2232
2225
[=named property deleter=],
2233
2226
and at most one of each variety of getter and setter.
2234
- Multiple legacy callers can exist on an interface
2235
- to specify overloaded calling behavior.
2236
2227
2237
2228
If an interface has a setter of a given variety,
2238
2229
then it must also have a getter of that
@@ -2252,73 +2243,6 @@ that defines a given special operation, then it is undefined which (if any)
2252
2243
special operation is invoked for that operation.
2253
2244
2254
2245
2255
- <h5 id="idl-legacy-callers">Legacy callers</h5>
2256
-
2257
- When an [=interface=] has one or more
2258
- [=legacy callers=], it indicates that objects that implement
2259
- the interface can be called as if they were functions. As mentioned above,
2260
- legacy callers can be specified using an [=operation=]
2261
- declared with the <emu-t>legacycaller</emu-t> keyword.
2262
-
2263
- <pre highlight="webidl" class="syntax">
2264
- interface interface_identifier {
2265
- legacycaller return_type identifier(/* arguments... */);
2266
- legacycaller return_type (/* arguments... */);
2267
- };
2268
- </pre>
2269
-
2270
- If multiple legacy callers are specified on an interface, overload resolution
2271
- is used to determine which legacy caller is invoked when the object is called
2272
- as if it were a function.
2273
-
2274
- [=Legacy callers=] can only be defined on interfaces that also
2275
- [=support indexed properties|support indexed=] or
2276
- [=support named properties|named properties=].
2277
-
2278
- Note: This artificial restriction allows bundling all interfaces with exotic object behavior
2279
- into a single [=platform object=] category: [=legacy platform objects=].
2280
- This is possible because all existing interfaces which have a [=legacy caller=]
2281
- also [=support indexed properties|supports indexed=] or
2282
- [=support named properties|named properties=].
2283
-
2284
- Legacy callers must not be defined to return a [=promise type=].
2285
-
2286
- <p class="advisement">
2287
- Legacy callers are universally recognised as an undesirable feature. They exist
2288
- only so that legacy Web platform features can be specified. Legacy callers
2289
- should not be used in specifications unless required to
2290
- specify the behavior of legacy APIs, and even then this should be discussed on
2291
-
2292
- mailing list before proceeding.
2293
- </p>
2294
-
2295
- <div class="example">
2296
-
2297
- The following [=IDL fragment=]
2298
- defines an [=interface=]
2299
- with a [=legacy caller=].
2300
-
2301
- <pre highlight="webidl">
2302
- interface NumberQuadrupler {
2303
- // This operation simply returns four times the given number x.
2304
- legacycaller double compute(double x);
2305
- };
2306
- </pre>
2307
-
2308
- An ECMAScript implementation supporting this interface would
2309
- allow a [=platform object=]
2310
- that implements <code class="idl">NumberQuadrupler</code>
2311
- to be called as a function:
2312
-
2313
- <pre highlight="js">
2314
- var f = getNumberQuadrupler(); // Obtain an instance of NumberQuadrupler.
2315
-
2316
- f.compute(3); // This evaluates to 12.
2317
- f(3); // This also evaluates to 12.
2318
- </pre>
2319
- </div>
2320
-
2321
-
2322
2246
<h5 id="idl-stringifiers">Stringifiers</h5>
2323
2247
2324
2248
When an [=interface=] has a
@@ -2797,17 +2721,13 @@ of an overloaded operation is used to invoke one of the
2797
2721
operations on an object that implements the interface, the
2798
2722
number and types of the arguments passed to the operation
2799
2723
determine which of the overloaded operations is actually
2800
- invoked. If an interface has multiple
2801
- [=legacy callers=] defined on it,
2802
- then those legacy callers are also said to be overloaded.
2803
- In the ECMAScript language binding, <a href="#Constructor">constructors</a>
2724
+ invoked. In the ECMAScript language binding, <a href="#Constructor">constructors</a>
2804
2725
can be overloaded too. There are some restrictions on the arguments
2805
- that overloaded operations, legacy callers and constructors can be
2726
+ that overloaded operations and constructors can be
2806
2727
specified to take, and in order to describe these restrictions,
2807
2728
the notion of an <em>effective overload set</em> is used.
2808
2729
2809
- [=Operations=] and [=legacy callers=]
2810
- must not be overloaded across [=interface=]
2730
+ [=Operations=] must not be overloaded across [=interface=]
2811
2731
and [=partial interface=] definitions.
2812
2732
2813
2733
<div class="note">
@@ -2842,8 +2762,7 @@ An <dfn id="dfn-effective-overload-set" export>effective overload set</dfn>
2842
2762
represents the allowable invocations for a particular
2843
2763
[=operation=],
2844
2764
constructor (specified with [{{Constructor}}]
2845
- or [{{NamedConstructor}}]),
2846
- [=legacy caller=] or
2765
+ or [{{NamedConstructor}}]), or
2847
2766
[=callback function=].
2848
2767
The algorithm to compute an [=effective overload set=]
2849
2768
operates on one of the following six types of IDL constructs, and listed with them below are
@@ -2854,9 +2773,6 @@ the inputs to the algorithm needed to compute the set.
2854
2773
:: * the [=interface=] on which the [=operations=] are to be found
2855
2774
* the [=identifier=] of the operations
2856
2775
* the number of arguments to be passed
2857
- : For legacy callers
2858
- :: * the [=interface=] on which the [=legacy callers=] are to be found
2859
- * the number of arguments to be passed
2860
2776
: For constructors
2861
2777
:: * the [=interface=] on which the [{{Constructor}}] [=extended attributes=] are to be found
2862
2778
* the number of arguments to be passed
@@ -2869,14 +2785,14 @@ the inputs to the algorithm needed to compute the set.
2869
2785
* the number of arguments to be passed
2870
2786
2871
2787
An effective overload set is used, among other things, to determine whether there are ambiguities in the
2872
- overloaded operations, constructors and callers specified on an interface.
2788
+ overloaded operations and constructors specified on an interface.
2873
2789
2874
2790
The [=set/items=] of an [=effective overload set=] are [=tuples=] of the form
2875
2791
([=effective overload set tuple/callable=], [=type list=], [=optionality list=])
2876
2792
whose [=tuple/items=] are described below:
2877
2793
2878
2794
* A <dfn for="effective overload set tuple">callable</dfn> is an [=operation=]
2879
- if the [=effective overload set=] is for [=regular operations=], [=static operations=] or [=legacy callers =];
2795
+ if the [=effective overload set=] is for [=regular operations=] or [=static operations =];
2880
2796
it is an [=extended attribute=] if the [=effective overload set=] is for constructors or [=named constructors=];
2881
2797
and it is the [=callback function=] itself if the [=effective overload set=] is for [=callback functions=].
2882
2798
* A <dfn>type list</dfn> is a [=list=] of IDL types.
@@ -2888,7 +2804,7 @@ whose [=tuple/items=] are described below:
2888
2804
or corresponds to a [=variadic=] argument.
2889
2805
2890
2806
Each [=tuple=] represents an allowable invocation of the operation,
2891
- constructor, legacy caller or callback function with an argument value list of the given types.
2807
+ constructor, or callback function with an argument value list of the given types.
2892
2808
Due to the use of [=optional arguments=]
2893
2809
and [=variadic=] operations
2894
2810
and constructors, there may be multiple items in an effective overload set identifying
@@ -2927,9 +2843,6 @@ the same operation or constructor.
2927
2843
[=extended attributes=] on interface |I| whose
2928
2844
[=takes a named argument list|named argument lists’=]
2929
2845
identifiers are |A|.
2930
- : For legacy callers
2931
- :: The elements of |F| are the [=legacy callers=]
2932
- defined on interface |I|.
2933
2846
: For callback functions
2934
2847
:: The single element of |F| is the callback function itself, |C|.
2935
2848
</dl>
@@ -4815,8 +4728,7 @@ object that are considered to be platform objects:
4815
4728
[=platform objects=] that implement an [=interface=] which
4816
4729
does not have a [{{Global}}] or [{{PrimaryGlobal}}] [=extended attribute=],
4817
4730
[=support indexed properties|supports indexed=] or
4818
- [=support named properties|named properties=],
4819
- and may have one or multiple [=legacy callers=].
4731
+ [=support named properties|named properties=].
4820
4732
4821
4733
In a browser, for example,
4822
4734
the browser-implemented DOM objects (implementing interfaces such as <code class="idl">Node</code> and
@@ -12158,29 +12070,6 @@ and [[#legacy-platform-object-set]].
12158
12070
</div>
12159
12071
12160
12072
12161
- <h4 id="legacy-platform-object-call" oldids="call">\[[Call]]</h4>
12162
-
12163
- <div algorithm="to invoke the internal [[Call]] method of legacy platform objects">
12164
-
12165
- The internal \[[Call]] method of [=legacy platform object=] that implements
12166
- an [=interface=] |I| must behave as follows,
12167
- assuming |arg|<sub>0..|n|−1</sub> is the list of argument values passed to \[[Call]]:
12168
-
12169
- 1. If |I| has no [=legacy callers=],
12170
- [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
12171
- 1. Initialize |S| to the [=effective overload set=]
12172
- for legacy callers on |I| and with argument count |n|.
12173
- 1. Let <|operation|, |values|> be the result of passing |S| and
12174
- |arg|<sub>0..|n|−1</sub> to the [=overload resolution algorithm=].
12175
- 1. Perform the actions listed in the description of the legacy caller |operation| with
12176
- |values| as the argument values.
12177
- 1. Return the result of [=converted to an ECMAScript value|converting=]
12178
- the return value from those actions to an ECMAScript value of the type
12179
- |operation| is declared to return (or <emu-val>undefined</emu-val>
12180
- if |operation| is declared to return {{void}}).
12181
- </div>
12182
-
12183
-
12184
12073
<h4 id="legacy-platform-object-preventextensions" oldids="preventextensions">\[[PreventExtensions]]</h4>
12185
12074
12186
12075
<div algorithm="to invoke the internal [[PreventExtensions]] method of legacy platform objects">
0 commit comments