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

Should "constructor" be allowed as an argument name? #779

Closed
Ms2ger opened this issue Aug 28, 2019 · 2 comments · Fixed by #786
Closed

Should "constructor" be allowed as an argument name? #779

Ms2ger opened this issue Aug 28, 2019 · 2 comments · Fixed by #786

Comments

@Ms2ger
Copy link
Member

Ms2ger commented Aug 28, 2019

See #700, whatwg/html#4869.

CC @annevk

@annevk
Copy link
Member

annevk commented Aug 28, 2019

If this is as easy as for async I think allowing this would be great. There's an emerging pattern of APIs taking constructors and not being able to use the obvious name would be rather unfortunate and a likely continuing source of confusion.

@bzbarsky
Copy link
Collaborator

Yes, we should do it. In particular, I think we should add "constructor" to ArgumentNameKeyword, and maybe allow it in dictionary member names (will need a new production). Not sure about AttributeNameKeyword; it's a little weird to add an attribute named "constructor", given that JS already has semantics for that.

I don't know why https://searchfox.org/mozilla-central/rev/325c1a707819602feff736f129cb36055ba6d94f/dom/webidl/CustomElementRegistry.webidl#8 was named "functionConstructor" instead of "constructor". :( It's that way in the first patches in https://bugzilla.mozilla.org/show_bug.cgi?id=1275833 which already don't match the spec IDL...

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

Successfully merging a pull request may close this issue.

3 participants