17b9d8728a
EscapeRegExpPattern should return a string representation of a RegExp instance that in turn can be used to construct a new RegExp instance with the same internal state as the original one. Previous versions incorrectly escaped '/' also inside character classes (e.g. /[/]/ returned "[\/]"). This patch properly escapes '/' when necessary and omits unnecessary escapes. Bug: v8:8615, v8:1982, v8:9446 Change-Id: I4ecb993dc69d6976f4637cedf43465cd0c32e427 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1688050 Commit-Queue: Patrick Thier <pthier@google.com> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org> Reviewed-by: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#62587} |
||
---|---|---|
.. | ||
alternative-length-miscalculation-expected.txt | ||
alternative-length-miscalculation.js | ||
assertion-expected.txt | ||
assertion.js | ||
constructor-expected.txt | ||
constructor.js | ||
dotstar-expected.txt | ||
dotstar.js | ||
early-acid3-86-expected.txt | ||
early-acid3-86.js | ||
ecma-regex-examples-expected.txt | ||
ecma-regex-examples.js | ||
invalid-range-in-class-expected.txt | ||
invalid-range-in-class.js | ||
lastIndex-expected.txt | ||
lastIndex.js | ||
malformed-escapes-expected.txt | ||
malformed-escapes.js | ||
non-capturing-backtracking-expected.txt | ||
non-capturing-backtracking.js | ||
overflow-expected.txt | ||
overflow.js | ||
parentheses-expected.txt | ||
parentheses.js | ||
pcre-test-4-expected.txt | ||
pcre-test-4.js | ||
quantified-assertions-expected.txt | ||
quantified-assertions.js | ||
repeat-match-waldemar-expected.txt | ||
repeat-match-waldemar.js | ||
toString-expected.txt | ||
toString.js | ||
unicodeCaseInsensitive-expected.txt | ||
unicodeCaseInsensitive.js |