Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define "usual constructor steps" #797

Merged
merged 5 commits into from
Sep 24, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Define "usual constructor steps"
This is for use in [HTMLConstructor] in whatwg/html#4915.
  • Loading branch information
domenic committed Sep 17, 2019
commit bb8df2f645e7d03b75f18f6f70e55781505038e6
7 changes: 5 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -11126,13 +11126,13 @@ and is described in more detail in [[#interface-prototype-object]].
Note: Since an [=interface object=] is a [=function object=]
the <code>typeof</code> operator will return "function" when applied to an interface object.

<div algorithm>
<div algorithm="create an interface object">

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

1. Let |steps| be the following steps:
1. Let |steps| be the following steps, known as the <dfn export>usual constructor steps</dfn>:
1. If |I| was not declared with a [=constructor operation=],
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
1. If {{NewTarget}} is <emu-val>undefined</emu-val>, then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the first two steps, even when overriding the rest of the algorithm?

Maybe also the last four steps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that would work for [HTMLConstructor], although it feels cleaner to just have a general primitive that replaces the whole thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep it like this for now, but we can refactor later if you think it's much better.

Expand Down Expand Up @@ -11186,6 +11186,9 @@ the <code>typeof</code> operator will return "function" when applied to an inter
1. [=Define the static operations=] of [=interface=] |I| on |F| given |realm|.
1. Return |F|.

Other specifications may require that, under certain circumstances, a different set of steps
replace the [=usual constructor steps=].

</div>


Expand Down