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

Make void a generic BindingIdentifier #88

Closed
bergus opened this issue May 27, 2022 · 1 comment
Closed

Make void a generic BindingIdentifier #88

bergus opened this issue May 27, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@bergus
Copy link

bergus commented May 27, 2022

The proposal currently only allows using void = … as a special form of the UsingDeclaration, adding a special case [+Using] void Initializer to the LexicalBinding production.

I think it would be more consistent to allow void in any place where a BindingIdentifier is allowed. This would allow a lot of useful patterns where currently _ is often used to indicate an unused variable (or _unused1, _unused2 if multiple bindings were to be declared):

const void = ;
let void = ;
var void = ;
using void = ;
for (const void of ) {}
const {x: void, y: void, ...rest} = ;
const [void, void, ...rest] = ;
function (void, second) {}
onClick = (void) => {};
@rbuckton rbuckton added the duplicate This issue or pull request already exists label May 27, 2022
@rbuckton
Copy link
Collaborator

This is a duplicate of #77, and I've already commented as to my position in that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants