This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] support null operators.
ClosedPublic

Authored by mprobst on Nov 7 2019, 2:49 PM.

Details

Summary

JavaScript / TypeScript is adding two new operators: the null
propagating operator ?. and the nullish coalescing operator ??.

const x = foo ?? 'default';
const z = foo?.bar?.baz;

This change adds support to lex and format both.

Event Timeline

mprobst created this revision.Nov 7 2019, 2:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2019, 2:49 PM
This revision is now accepted and ready to land.Nov 7 2019, 3:30 PM
MyDeveloperDay added a project: Restricted Project.Nov 7 2019, 3:30 PM
mprobst updated this revision to Diff 228495.Nov 8 2019, 10:35 AM

Add tests for .?(foo) and .?[foo].

This revision was automatically updated to reflect the committed changes.