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

Normative requirements for constructor names? #775

Closed
ricea opened this issue Aug 23, 2017 · 3 comments
Closed

Normative requirements for constructor names? #775

ricea opened this issue Aug 23, 2017 · 3 comments
Assignees

Comments

@ricea
Copy link
Collaborator

ricea commented Aug 23, 2017

Is WritableStream.name required to return "WritableStream"?

Is new WritableStream().getWriter().constructor.name required to return "WritableStreamDefaultWriter"?

@domenic
Copy link
Member

domenic commented Aug 23, 2017

Yes: https://tc39.github.io/ecma262/#sec-ecmascript-standard-built-in-objects

Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. For functions that are specified as properties of objects, the name value is the property name string used to access the function. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string. The value of the name property is explicitly specified for each built-in functions whose property key is a Symbol value.

plus https://streams.spec.whatwg.org/#conventions , which admittedly doesn't say exactly which ES clauses it's meant to cover.

@ricea
Copy link
Collaborator Author

ricea commented Aug 23, 2017

Thanks. I will add test(s).

@ricea
Copy link
Collaborator Author

ricea commented Aug 29, 2017

PR: web-platform-tests/wpt#7035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants