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 whitespaces be allowed in await.ops? #12

Closed
JLHwung opened this issue Aug 10, 2020 · 3 comments · Fixed by #13
Closed

Should whitespaces be allowed in await.ops? #12

JLHwung opened this issue Aug 10, 2020 · 3 comments · Fixed by #13

Comments

@JLHwung
Copy link
Contributor

JLHwung commented Aug 10, 2020

Among the . related grammar productions, both MetaProperty and MemberExpression allow whitespaces around .

new
////
  .target

We discussed in #10 that await* can be a thing, so we can look at YieldExpression: The YieldExpression allows whitespaces in yield * except line terminators between yield and *.

To align with current grammar and how JS developers feel about . notation. I think whitespaces should be allowed

awaitOps:
await . all
await . allSettled
await . race
await . any

I don't have strong opinion on line terminators. I am good with disallowing line terminators or allowing, and before . or/and after ..

@ljharb
Copy link
Member

ljharb commented Aug 10, 2020

I’d personally prefer to forbid whitespace on either side of the dot, and i can’t recall the last time i even saw code that had any whitespace around the dot in any context - but consistency with new.target seems like the proper path to take.

@Jack-Works
Copy link
Member

The current syntax doesn't allow space (or break lines) and I think we keep it.

@Jack-Works
Copy link
Member

Oh I prefer to keep consistency with new.target and import.meta (if they accepts spaces)

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 a pull request may close this issue.

3 participants