[regexp] fix subtle bug in RegExpTest.
R=bmeurer@chromium.org Review-Url: https://codereview.chromium.org/2032713003 Cr-Commit-Position: refs/heads/master@{#36670}
This commit is contained in:
parent
864b07e9eb
commit
7ca611d1a5
@ -325,10 +325,10 @@ function RegExpTest(string) {
|
||||
// not a '?'. But see https://code.google.com/p/v8/issues/detail?id=3560
|
||||
var regexp = this;
|
||||
var source = REGEXP_SOURCE(regexp);
|
||||
if (regexp.length >= 3 &&
|
||||
%_StringCharCodeAt(regexp, 0) == 46 && // '.'
|
||||
%_StringCharCodeAt(regexp, 1) == 42 && // '*'
|
||||
%_StringCharCodeAt(regexp, 2) != 63) { // '?'
|
||||
if (source.length >= 3 &&
|
||||
%_StringCharCodeAt(source, 0) == 46 && // '.'
|
||||
%_StringCharCodeAt(source, 1) == 42 && // '*'
|
||||
%_StringCharCodeAt(source, 2) != 63) { // '?'
|
||||
regexp = TrimRegExp(regexp);
|
||||
}
|
||||
// matchIndices is either null or the RegExpLastMatchInfo array.
|
||||
|
Loading…
Reference in New Issue
Block a user