Chromium Code Reviews| Index: src/string.js |
| diff --git a/src/string.js b/src/string.js |
| index 18ef3d88bde20e9e770015102230d6a449afa824..55943846b9784dec26ff3d02c6da9976996f1448 100644 |
| --- a/src/string.js |
| +++ b/src/string.js |
| @@ -157,21 +157,8 @@ function StringMatch(regexp) { |
| if (!regexp.global) return regexp.exec(subject); |
| %_Log('regexp', 'regexp-match,%0S,%1r', [subject, regexp]); |
| - var matches = DoRegExpExecGlobal(regexp, subject); |
| - |
| - // If the regexp did not match, return null. |
| - if (matches.length == 0) return null; |
| - |
| - // Build the result array. |
| - var result = new $Array(match_string); |
| - for (var i = 0; i < matches.length; ++i) { |
| - var matchInfo = matches[i]; |
| - var match_string = subject.slice(matchInfo[CAPTURE0], |
| - matchInfo[CAPTURE1]); |
| - result[i] = match_string; |
| - } |
| - |
| - return result; |
| + // lastMatchInfo is defined in regexp-delay.js |
|
Erik Corry
2009/03/25 11:29:46
full stop
|
| + return %StringMatch(subject, regexp, lastMatchInfo); |
| } |