Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Address further editor feedback #33

Merged
merged 1 commit into from Jan 16, 2021
Merged

Address further editor feedback #33

merged 1 commit into from Jan 16, 2021

Conversation

rbuckton
Copy link
Collaborator

@rbuckton rbuckton commented Jan 15, 2021

@bakkot: this is intended to address your feedback from #22 (comment) and #30 (comment).

I'm still considering if there's something more I need to do to address (await) => {} in a static block to reserve await for possible future support.

I've also taken the opportunity to update the baseline spec text that has changed since this spec was written (i.e., the introduction of ClassElementKind).

@rbuckton rbuckton requested a review from bakkot January 15, 2021 22:15
Copy link

@bakkot bakkot left a comment

Choose a reason for hiding this comment

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

LGTM

I'm still considering if there's something more I need to do to address (await) => {} in a static block to reserve await for possible future support.

For that point, I think it's probably OK to decide that (await) => {} is not legal in static blocks. I think you do need to call it out explicitly, somehow, since it's not totally clear whether the await in (await) => {} counts as "crossing function boundaries". I'm not sure exactly how to word that.

(FWIW I think the alternative you proposed, of parsing with [+Await] and forbidding AwaitExpression and for await, is probably simpler, but either approach should work in principle.)

@rbuckton rbuckton merged commit be72e4f into master Jan 16, 2021
@ljharb ljharb deleted the editorReview2 branch January 16, 2021 01:00
@rbuckton
Copy link
Collaborator Author

I'll need to give more thought to the (await) case. There's also function await() to consider. It would be so much easier if await was just a ReservedWord in strict mode.

@JLHwung
Copy link
Contributor

JLHwung commented Jan 20, 2021

FYI Babel will disallow the following cases (babel/babel#12661):

class C { static { function await() {} } }
class C { static { (await) => {} } }
class C { static { ({ [await]: x}) => {} } }

This is to align with the fact that

class C { static = function arguments() {} }
class C { static = (arguments) => {} }
class C { static = ({ [arguments]: x}) => {} }

is forbidden.

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

Successfully merging this pull request may close these issues.

None yet

3 participants