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

add Nullish Coalescing #890

Merged
merged 2 commits into from
Apr 13, 2020
Merged

Conversation

mysticatea
Copy link
Contributor

@mysticatea mysticatea commented Dec 5, 2019

This PR adds a new syntax Nullish Coalescing (?? operator).

Please mind the ESTree spec is on discussing. It might changes.

As a side effect, this PR adds a parameter to the parseExprOp method. The parameter is used to raise the syntax error of mixed short-circuit expressions. If a plugin doesn't pass the new parameter, acorn doesn't raise the syntax error. This PR no longer adds any parameters.

acorn/src/expression.js Outdated Show resolved Hide resolved
acorn/src/expression.js Outdated Show resolved Hide resolved
@staeke
Copy link

staeke commented Feb 15, 2020

can this be merged? why the wait?

@marijnh
Copy link
Member

marijnh commented Feb 16, 2020

See estree/estree#204

@BPScott
Copy link

BPScott commented Apr 13, 2020

Yay, estree/estree#204 got split into two and the uncontroversial nullish coalescing part got split out into estree/estree#211 - which as been merged, so I thiiink this is unblocked from the ESTree spec side

@marijnh marijnh merged commit ec7cbd1 into acornjs:master Apr 13, 2020
@marijnh
Copy link
Member

marijnh commented Apr 13, 2020

Wonderful. Shall I tag a release, on the assumption that optional chaining is going to take a while more?

@lukastaegert
Copy link

@marijnh That would be wonderful!

@marijnh
Copy link
Member

marijnh commented May 9, 2020

I've released 7.2.0

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 this pull request may close these issues.

None yet

7 participants