Commit 7ca611d1 authored by yangguo's avatar yangguo Committed by Commit bot

[regexp] fix subtle bug in RegExpTest.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2032713003
Cr-Commit-Position: refs/heads/master@{#36670}
parent 864b07e9
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment