Skip to content

Commit 3939e60

Browse files
committed
Rename [TreatNonObjectAsNull] to [LegacyTreatNonObjectAsNull]
Part of #350.
1 parent a162c1a commit 3939e60

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

index.bs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5531,7 +5531,7 @@ sign gives the signature of the callback function type.
55315531
be used as the type of a [=constant=].
55325532

55335533
The following extended attribute is applicable to callback functions:
5534-
[{{TreatNonObjectAsNull}}].
5534+
[{{LegacyTreatNonObjectAsNull}}].
55355535

55365536
<div data-fill-with="grammar-CallbackOrInterfaceOrMixin"></div>
55375537

@@ -6260,7 +6260,7 @@ An [=identifier=] that identifies
62606260
a [=callback function=] is used to refer to
62616261
a type whose values are references to objects that are functions with the given signature.
62626262

6263-
Note: If the [{{TreatNonObjectAsNull}}] [=extended attribute=] is specified on the [=definition=] of
6263+
Note: If the [{{LegacyTreatNonObjectAsNull}}] [=extended attribute=] is specified on the [=definition=] of
62646264
the [=callback function=], the values can be references to objects that are not functions.
62656265

62666266
An IDL value of the callback function type is represented by a tuple of an object
@@ -7980,7 +7980,7 @@ values.
79807980
<h4 id="es-callback-function">Callback function types</h4>
79817981

79827982
IDL [=callback function types=] are represented by ECMAScript [=function objects=], except in the
7983-
[{{TreatNonObjectAsNull}}] case, when they can be any object.
7983+
[{{LegacyTreatNonObjectAsNull}}] case, when they can be any object.
79847984

79857985
<div id="es-to-callback-function" algorithm="convert an ECMAScript value to callback function">
79867986

@@ -7993,7 +7993,7 @@ IDL [=callback function types=] are represented by ECMAScript [=function objects
79937993
to |V| being assigned to an [=attribute=]
79947994
whose type is a [=nullable type|nullable=]
79957995
[=callback function=]
7996-
that is annotated with [{{TreatNonObjectAsNull}}],
7996+
that is annotated with [{{LegacyTreatNonObjectAsNull}}],
79977997
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
79987998
1. Return the IDL [=callback function type=] value
79997999
that represents a reference to the same object that |V| represents, with the
@@ -8025,7 +8025,7 @@ the ECMAScript <emu-val>null</emu-val> value.
80258025
to |V| being assigned to an [=attribute=]
80268026
whose type is a [=nullable type|nullable=]
80278027
[=callback function=]
8028-
that is annotated with [{{TreatNonObjectAsNull}}],
8028+
that is annotated with [{{LegacyTreatNonObjectAsNull}}],
80298029
then return the IDL
80308030
[=nullable type=] <code class="idl">|T|?</code>
80318031
value <emu-val>null</emu-val>.
@@ -10630,21 +10630,21 @@ that does specify [{{SecureContext}}].
1063010630
</div>
1063110631

1063210632

10633-
<h4 id="TreatNonObjectAsNull" extended-attribute lt="TreatNonObjectAsNull">[TreatNonObjectAsNull]</h4>
10633+
<h4 id="LegacyTreatNonObjectAsNull" extended-attribute lt="LegacyTreatNonObjectAsNull" oldids="TreatNonObjectAsNull">[LegacyTreatNonObjectAsNull]</h4>
1063410634

1063510635
<div class="advisement">
1063610636

10637-
The [{{TreatNonObjectAsNull}}] [=extended attribute=] is an undesirable feature.
10637+
The [{{LegacyTreatNonObjectAsNull}}] [=extended attribute=] is an undesirable feature.
1063810638
It exists only so that legacy Web platform features can be specified.
1063910639
It should not be used in specifications
1064010640
unless required to specify the behavior of legacy APIs,
1064110641
or for consistency with these APIs.
1064210642
Editors who wish to use this feature are strongly advised to discuss this
10643-
by <a href="https://github.com/heycam/webidl/issues/new?title=Intent%20to%20use%20[TreatNonObjectAsNull]">filing an issue</a>
10643+
by <a href="https://github.com/heycam/webidl/issues/new?title=Intent%20to%20use%20[LegacyTreatNonObjectAsNull]">filing an issue</a>
1064410644
before proceeding.
1064510645

1064610646
<small class="non-normative">
10647-
The [{{TreatNonObjectAsNull}}] [=extended attribute=] appears on
10647+
The [{{LegacyTreatNonObjectAsNull}}] [=extended attribute=] appears on
1064810648
the [=callback functions=] {{EventHandlerNonNull}},
1064910649
{{OnBeforeUnloadEventHandlerNonNull}}, and
1065010650
{{OnErrorEventHandlerNonNull}}
@@ -10654,27 +10654,27 @@ that does specify [{{SecureContext}}].
1065410654

1065510655
</div>
1065610656

10657-
If the [{{TreatNonObjectAsNull}}] [=extended attribute=] appears on a [=callback function=], then
10657+
If the [{{LegacyTreatNonObjectAsNull}}] [=extended attribute=] appears on a [=callback function=], then
1065810658
it indicates that any value assigned to an [=attribute=] whose type is a [=nullable type|nullable=]
1065910659
[=callback function=] will be converted more loosely: if the value is not an object, it will be
1066010660
converted to null, and if the value is not [=ECMAScript/callable=], it will be converted to a
1066110661
[=callback function=] value that does nothing when called.
1066210662

1066310663
See [[#es-nullable-type]], [[#es-callback-function]] and [[#es-invoking-callback-functions]]
1066410664
for the specific requirements that the use of
10665-
[{{TreatNonObjectAsNull}}] entails.
10665+
[{{LegacyTreatNonObjectAsNull}}] entails.
1066610666

1066710667
<div class="example">
1066810668

1066910669
The following [=IDL fragment=] defines an interface that has one
10670-
attribute whose type is a [{{TreatNonObjectAsNull}}]-annotated
10670+
attribute whose type is a [{{LegacyTreatNonObjectAsNull}}]-annotated
1067110671
[=callback function=] and another whose type is a
1067210672
[=callback function=] without the [=extended attribute=]:
1067310673

1067410674
<pre highlight="webidl">
1067510675
callback OccurrenceHandler = void (DOMString details);
1067610676

10677-
[TreatNonObjectAsNull]
10677+
[LegacyTreatNonObjectAsNull]
1067810678
callback ErrorHandler = void (DOMString details);
1067910679

1068010680
[Exposed=Window]
@@ -14083,7 +14083,7 @@ described in the previous section).
1408314083
1. Let |F| be the ECMAScript object corresponding to |callable|.
1408414084
1. If [=!=] <a abstract-op>IsCallable</a>(|F|) is <emu-val>false</emu-val>:
1408514085
1. Note: This is only possible when the [=callback function=] came from an attribute
14086-
marked with [{{TreatNonObjectAsNull}}].
14086+
marked with [{{LegacyTreatNonObjectAsNull}}].
1408714087
1. If the callback function's return type is {{void}}, return.
1408814088
1. Return the result of [=converted to an IDL value|converting=]
1408914089
<emu-val>undefined</emu-val> to the callback function's return type.

0 commit comments

Comments
 (0)