prettier/tests/nullish_coalescing
Christopher Chedeau 43d03209d2
Update ?? precedence to match stage 3 proposal (#6404)
The spec was updated ( https://tc39.es/proposal-nullish-coalescing/ ) with the following two changes:
- ?? has lower precedence than ||. (previously equal)
- ?? cannot immediately contain, or be contained within, an && or || operation. (parens are now required)

The safe way to upgrade is to run prettier with just this change so that parenthesis are properly added. Then to upgrade the parser (only flow supports the new precendence in the next release, babel hasn't been updated yet) in prettier so that the new precedence is being used. Failure to do so will result in parse errors because of missing parenthesis so we will not have silent errors.

There was only 44 callsites mixing || and ?? in a confusing way in the Facebook codebase so it shouldn't be a huge deal in practice.
2019-08-20 14:26:21 -07:00
..
__snapshots__ Update ?? precedence to match stage 3 proposal (#6404) 2019-08-20 14:26:21 -07:00
jsfmt.spec.js Rename "babylon" with "babel" (#5647) 2018-12-27 21:05:19 +08:00
nullish_coalesing_operator.js Update ?? precedence to match stage 3 proposal (#6404) 2019-08-20 14:26:21 -07:00