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

Nullish coalescing operator ?? #203

Closed
jorendorff opened this issue Nov 7, 2019 · 9 comments · Fixed by #204
Closed

Nullish coalescing operator ?? #203

jorendorff opened this issue Nov 7, 2019 · 9 comments · Fixed by #204

Comments

@jorendorff
Copy link

Stage 3 proposal
Spec repo: https://github.com/tc39/proposal-nullish-coalescing

(Related to #146 optional chaining, but an independent proposal.) We just implemented ?? in SpiderMonkey. It's a short-circuiting binary operator, more like || than anything else, but calling it a LogicalExpression is a stretch.

@RReverser
Copy link
Member

Hmm. Adding it as a LogicalExpression operator could be nice / easy implementation-wise, but I see why semantically it doesn't make much sense.

@hzoo @loganfsmyth @danez What do you think?

@michaelficarra
Copy link
Member

LogicalExpression seems fine to me.

@codehag
Copy link

codehag commented Nov 12, 2019

In the proposed specification LogicalExpression is updated to ShortCircuitExpression - does it make sense to update it here as well?

@michaelficarra
Copy link
Member

@codehag The organisation and names of the grammar productions in the spec should not affect our designs here. Also, estree cannot make backward incompatible changes such as the one you suggest.

@codehag
Copy link

codehag commented Nov 12, 2019

ok, thanks for the context

@jorendorff
Copy link
Author

Thanks for the replies here. We're implementing this in SpiderMonkey with "LogicalExpression" in https://phabricator.services.mozilla.com/D52690.

@fabiosantoscode
Copy link

👍 Terser will follow suit.

@JLHwung
Copy link
Contributor

JLHwung commented Jun 5, 2020

This issue is fixed by #211.

@RReverser
Copy link
Member

@JLHwung Right, thanks.

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.

6 participants