Skip to content

Commit 9c59759

Browse files
authored
Define "overridden constructor steps"
This is for use in [HTMLConstructor] in whatwg/html#4915.
1 parent 9e514c9 commit 9c59759

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

index.bs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11131,13 +11131,25 @@ and is described in more detail in [[#interface-prototype-object]].
1113111131
Note: Since an [=interface object=] is a [=function object=]
1113211132
the <code>typeof</code> operator will return "function" when applied to an interface object.
1113311133

11134+
An interface may have <dfn export>overridden constructor steps</dfn>, which can
11135+
change the behavior of the [=interface object=] when called or constructed. By
11136+
default interfaces do not have such steps.
11137+
11138+
<p class="advisement">
11139+
In general, constructors are described by defining a [=constructor operation=] and its behavior.
11140+
The [=overridden constructor steps=] are used only for more complicated situations.
11141+
Editors who wish to use this feature are strongly advised to discuss this by
11142+
<a href="https://github.com/heycam/webidl/issues/new?title=Intent%20to%20use%20constructor%20steps">filing an issue</a> before proceeding.
11143+
</p>
11144+
1113411145
<div algorithm>
1113511146

1113611147
The [=interface object=] for a given [=interface=] |I|
1113711148
with [=identifier=] |id| and in [=Realm=] |realm|
1113811149
is <dfn lt="create an interface object">created</dfn> as follows:
1113911150

11140-
1. Let |steps| be the following steps:
11151+
1. Let |steps| be |I|'s [=overriden constructor steps=] if they exist, or
11152+
the following steps otherwise:
1114111153
1. If |I| was not declared with a [=constructor operation=],
1114211154
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
1114311155
1. If {{NewTarget}} is <emu-val>undefined</emu-val>, then

0 commit comments

Comments
 (0)