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

Normative: Add Nullish Coalescing #1644

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Jul 24, 2019

This change adds the relevant updates for the stage 3 Nullish Coalescing proposal. The intended changes can be viewed at https://tc39.es/proposal-nullish-coalescing/.

The Test262 PR is available at tc39/test262#2402

@ljharb ljharb added needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 normative change Affects behavior required to correctly evaluate some ECMAScript source text pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4. labels Jul 24, 2019
@ljharb ljharb requested review from waldemarhorwat, zenparsing, ljharb and a team July 24, 2019 20:16
@anba
Copy link
Contributor

anba commented Jul 24, 2019

The ?In -> +In change for ConditionalExpression is incorrect.

spec.html Outdated Show resolved Hide resolved
facebook-github-bot pushed a commit to facebook/flow that referenced this pull request Aug 6, 2019
Summary:
updates parsing of the nullish coalescing operator (`??`) based on the updated stage 3 draft (tc39/ecma262#1644). this specific change happened in tc39/proposal-nullish-coalescing#39.

Changelog: fix(parser): Updated parsing of the experimental nullish coalescing `??` operator. It now has a lower precedence than `||` and `&&`, and parentheses are required to nest it with them.

Reviewed By: gabelevi

Differential Revision: D16561382

fbshipit-source-id: 099ef58bc6cfa90ff3a3153636363986aab2f158
@ljharb ljharb removed request for a team and zenparsing October 12, 2019 05:06
@syg syg self-requested a review October 17, 2019 00:25
@ljharb
Copy link
Member

ljharb commented Oct 30, 2019

@DanielRosenwasser please rebase this PR, and either link to the test262 tests PR, or put one up, prior to the December meeting. Thanks!

@bakkot
Copy link
Contributor

bakkot commented Oct 31, 2019

@DanielRosenwasser I think you messed up the rebase?

Fixed as I was typing this, ignore me.

@DanielRosenwasser
Copy link
Member Author

I did! But I unbroke it and after a little bit of fiddling and waiting, GitHub is less angry with me and let me reopen the PR. 🙂

@DanielRosenwasser
Copy link
Member Author

DanielRosenwasser commented Oct 31, 2019

Also, this PR now links to tc39/test262#2402, the test262 additions PR.

Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

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

lgtm!

@ljharb ljharb added has test262 tests and removed needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 labels Oct 31, 2019
@ljharb ljharb requested a review from a team October 31, 2019 03:07
@ljharb ljharb self-assigned this Oct 31, 2019
Copy link
Member

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

🙌🎉🎊💰

@claudepache
Copy link
Contributor

As noted in tc39/proposal-nullish-coalescing#59, the token ?? must be added to the Punctuator production of the Lexical grammar.

@ljharb ljharb added has stage 4 This PR represents a proposal that has achieved stage 4, and is ready to merge. and removed pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. labels Dec 12, 2019
@ljharb ljharb force-pushed the nullish-coalescing branch from 0c2dc5a to 7f8129b Compare December 12, 2019 04:13
@ljharb
Copy link
Member

ljharb commented Dec 12, 2019

@claudepache done.

@ljharb ljharb merged commit 7f8129b into tc39:master Dec 12, 2019
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Dec 12, 2019
ljharb pushed a commit to jmdyck/ecma262 that referenced this pull request Jan 2, 2020
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Jan 22, 2020
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Jan 23, 2020
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Feb 4, 2020
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Feb 5, 2020
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Feb 13, 2020
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Feb 13, 2020
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Feb 15, 2020
ljharb pushed a commit to jmdyck/ecma262 that referenced this pull request Feb 19, 2020
 - insert space before paren in clause heading
 - eliminate grammatical parameters from non-defining production
 - Add 4 <emu-prodref> elements to Annex A
 - tweak syntax in algorithms
 - eliminate accidental ambiguity in Punctuator
      PR tc39#1646 introduced an ambiguity to the lexical grammar:
      Punctuator derives OtherPunctuator in two different ways --
      directly, and indirectly via OptionalChainingPunctuator.

      It doesn't make sense for OptionalChainingPunctuator to derive OtherPunctuator,
      so I've eliminated that alternative.
 - minor grammar refactoring re Punctuator
      Move the Punctuator production back to its former position.
      (Grammars are generally written top-down.)
 - Fix a 'use' production for AsyncConciseBody to match the new defining production
 - Add an <emu-prodref> for ExpressionBody to Annex A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has stage 4 This PR represents a proposal that has achieved stage 4, and is ready to merge. has test262 tests normative change Affects behavior required to correctly evaluate some ECMAScript source text proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants