-
Notifications
You must be signed in to change notification settings - Fork 869
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
Work on ECMAScript 2017? #441
Comments
Trailing commas are allowed in ES2017 in both function declarations/expressions and in call expressions. This commit adds support for both. Refs acornjs#441
async/await is now stage 4 as well. |
I spent a couple hours hacking on parsing async/await this morning. It seems trickier than it initially appeared. AFAICT parsing async functions robustly without some form of backtracking or lookahead will involve a lot of duplication of code, or some significant refactoring (I'm new to the acorn codebase, but as far as I could tell the tokenizer doesn't support backtracking or lookahead). This arises from the fact that e.g.
Fortunately await should be easier. It looks like it's not allowed as an identifier inside an async function. |
I think we can do it under, of course, a new I suggest you might want to work together to figure out if there are any discrepancies with the formal spec syntax, and if not, we can bring it upstream. |
The goal with that was only as far as getting it to render and/or prettyprint better in Chrome devtools. I wasn't planning on doing any significant work to improve it in Acorn or other ES parsers. Anyways, per your question (assuming it was about the status of being ratified and moved into ECMA262), async functions is at Stage 4, so it might be time to start looking at getting support for that upstream. |
Huh, if I'm reading this right, it looks like |
Yeah, that sounds right. TBH, it wasn't written to be the nicest/fastest implementation, but it has a fair number of users and I think most of the wrinkles are now fixed (see issues on the plugin). I probably didn't spend enough time attempting to understand acorn in enough detail, so things like lookahead (which I think is needed to disambiguate things like |
For the record, it looks like #446 implements async/await |
#446 was merged. And yes, we're open to implementing other ES2017 pieces when they become stable. Closing this. |
@marijnh what about trailing function commas? That's the other syntactic change that's stage 4. |
Patches welcome, or otherwise we'll probably get to it when the standard as a whole is finalized. |
It's a living standard - it's finalized the instant it's merged. I'll file a separate issue for trailing function commas. |
I'm curious if you have thoughts about beginning to implement ES 2017 features as they are approved. This week it looks like several proposals will move to stage 4 ( one already has: tc39/proposals@6826a19, and it looks like async/await will tio), and as soon as that happens, ESLint tends to start receiving requests for support.
If you're open to it, I'm happy to work on proposals as they reach stage 4 and submit them as PRs.
The text was updated successfully, but these errors were encountered: