OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 %CheckIsBootstrapping(); | 7 %CheckIsBootstrapping(); |
8 | 8 |
9 // ------------------------------------------------------------------- | 9 // ------------------------------------------------------------------- |
10 // Imports | 10 // Imports |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 var matchIndices = %_RegExpExec(regexp, string, 0, RegExpLastMatchInfo); | 250 var matchIndices = %_RegExpExec(regexp, string, 0, RegExpLastMatchInfo); |
251 if (IS_NULL(matchIndices)) { | 251 if (IS_NULL(matchIndices)) { |
252 this.lastIndex = 0; | 252 this.lastIndex = 0; |
253 return false; | 253 return false; |
254 } | 254 } |
255 return true; | 255 return true; |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 function TrimRegExp(regexp) { | 259 function TrimRegExp(regexp) { |
260 if (!%_ObjectEquals(regexp_key, regexp)) { | 260 if (regexp_key !== regexp) { |
261 regexp_key = regexp; | 261 regexp_key = regexp; |
262 regexp_val = | 262 regexp_val = |
263 new GlobalRegExp( | 263 new GlobalRegExp( |
264 %_SubString(REGEXP_SOURCE(regexp), 2, REGEXP_SOURCE(regexp).length), | 264 %_SubString(REGEXP_SOURCE(regexp), 2, REGEXP_SOURCE(regexp).length), |
265 (REGEXP_IGNORE_CASE(regexp) ? REGEXP_MULTILINE(regexp) ? "im" : "i" | 265 (REGEXP_IGNORE_CASE(regexp) ? REGEXP_MULTILINE(regexp) ? "im" : "i" |
266 : REGEXP_MULTILINE(regexp) ? "m" : "")); | 266 : REGEXP_MULTILINE(regexp) ? "m" : "")); |
267 } | 267 } |
268 return regexp_val; | 268 return regexp_val; |
269 } | 269 } |
270 | 270 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 // Exports | 753 // Exports |
754 | 754 |
755 utils.Export(function(to) { | 755 utils.Export(function(to) { |
756 to.RegExpExec = DoRegExpExec; | 756 to.RegExpExec = DoRegExpExec; |
757 to.RegExpExecNoTests = RegExpExecNoTests; | 757 to.RegExpExecNoTests = RegExpExecNoTests; |
758 to.RegExpLastMatchInfo = RegExpLastMatchInfo; | 758 to.RegExpLastMatchInfo = RegExpLastMatchInfo; |
759 to.RegExpTest = RegExpTest; | 759 to.RegExpTest = RegExpTest; |
760 }); | 760 }); |
761 | 761 |
762 }) | 762 }) |
OLD | NEW |