-
Notifications
You must be signed in to change notification settings - Fork 889
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
add Optional Chaining #891
Conversation
73e7aa1
to
184b9d1
Compare
can this be merged? why the wait? |
We're also waiting for this so we can use this feature with webpack and without Babel. |
Could this and #890 please be merged? 🙏 It would open up these new language features to the many modules downstream that depend on acorn. It would also brighten up my day-to-day work by being able to use these two operators. It looks like many other people are excited too! |
@mysticatea @nzakas Is there any hope for an ESTree consensus for this on the short run? |
I’ll see if I can push it forward. |
@nzakas Any updates do we have? You're about to merge this, right? |
Don't post further impatient queries, or I'm locking this. We're waiting on the ESTree format to stabilize, and this'll be able to get merged as soon as that happens. |
We have some better idea of what we want, but there are some final details to discuss. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
No, if there were, they would be posted here. Please refrain from spamming the thread. |
61ad097
to
2d0d92c
Compare
2d0d92c
to
28222bf
Compare
I updated this PR for the approved version of ESTree spec. |
Wonderful! Merged and released as 7.3.0 |
Is it possible to backport this to v6 so that the feature is supported in webpack v4? |
@illeatmyhat Can Webpack upgrade to Acorn 7? There are very few breaking change, and they mainly relate to plugin APIs, most of which have already upgraded. |
@marijnh is there a typo in CHANGELOG.md? For 7.1.0, it says
However,
|
You appear to be looking at the changelog for acorn-loose, not acorn. |
Support for optional chaining becomes available on version 7.3.0 acornjs/acorn#891
This PR adds a new syntax Optional Chaining (
?.
operator).Language Spec: tc39/ecma262#1646
ESTree Spec: estree/estree#204
Please mind the ESTree spec is on discussing. It might changes.
Also, this PR adds a parameter to the
parseSubscript
method. The parameter is used to makeshortCircuited
property. Therefore, if a plugin doesn't pass the new parameter, acorn cannot makeshortCircuited
property properly (it become always false).