Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Fix regex for sanitizing date constructor in js_to_json
Given the following JavaScript code as string: [new Date("foobar"), '("baz")'] The greedy quantifier's usage matches the string till the last quote instead of just the text inside the parenthesis. This patch fixes that using the `STRING_RE` regex for matching string literals properly. Also updated tests.
- Loading branch information
Showing
2 changed files
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters