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

Editorial: Document constructor [[Call]] behavior #491

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

gibson042
Copy link
Contributor

Fixes #384

Copy link
Member

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

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

LGTM

<h1>API Conventions</h1>

<p>
Every built-in constructor should behave as if defined inside a class, throwing a *TypeError* exception when called as a function (without NewTarget). For backwards compatibility with past editions, this does not apply to %Collator%, %NumberFormat%, or %DateTimeFormat%, each of which construct and return a new object when called as a function.
Copy link
Member

Choose a reason for hiding this comment

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

It always bugs me that NewTarget goes without special quotes or between underscores in the spec source code. Although, this remains correct.

@leobalter leobalter merged commit 3f9efda into tc39:master Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should all new constructors throw when called as a function?
3 participants