Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: in ESTree, the `value` property of a regex is an instantiated `RegExp` object. if it can't be represented for some reason, the `value` should be `null`. there is also a `regex` property with the pattern and flags as strings so you can still tell what it was. JSON doesn't have regexes, so `flow ast` already returns null. `flow_parser.js` runs in a JS engine so it does try to create a `RegExp`. when creating a `RegExp` fatals, we previously tried to recover in a bogus way. it should return `null` instead. this fixes a crash when the browser engine doesn't support the latest regex flags, like `y`, `u` or `d`. Fixes #8886 Changelog: [parser] Fix a runtime exception when parsing regexes via the JS version of the parser Differential Revision: D36754295 fbshipit-source-id: 18ed0bd17f1265a4da3e241e8f3b08fa5b15b722
- Loading branch information