This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] exclaim preceding regex literals.
ClosedPublic

Authored by mprobst on Feb 7 2017, 5:27 AM.

Details

Summary

Regex detection would incorrectly classify a trailing ! operator
(nullability cast) followed by a / as the start of a regular
expression literal. This fixes code such as:

var foo = x()! / 10;

Which would previously parse a regexp all the way to the end of the
source file (or next /).

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.Feb 7 2017, 5:27 AM
djasper accepted this revision.Feb 7 2017, 5:52 AM

Looks good.

This revision is now accepted and ready to land.Feb 7 2017, 5:52 AM
This revision was automatically updated to reflect the committed changes.