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 'use strict'; | 7 'use strict'; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 } | 318 } |
319 this.lastIndex = RegExpLastMatchInfo[CAPTURE1]; | 319 this.lastIndex = RegExpLastMatchInfo[CAPTURE1]; |
320 return true; | 320 return true; |
321 } else { | 321 } else { |
322 // Non-global, non-sticky regexp. | 322 // Non-global, non-sticky regexp. |
323 // Remove irrelevant preceeding '.*' in a test regexp. The expression | 323 // Remove irrelevant preceeding '.*' in a test regexp. The expression |
324 // checks whether this.source starts with '.*' and that the third char is | 324 // checks whether this.source starts with '.*' and that the third char is |
325 // not a '?'. But see https://code.google.com/p/v8/issues/detail?id=3560 | 325 // not a '?'. But see https://code.google.com/p/v8/issues/detail?id=3560 |
326 var regexp = this; | 326 var regexp = this; |
327 var source = REGEXP_SOURCE(regexp); | 327 var source = REGEXP_SOURCE(regexp); |
328 if (regexp.length >= 3 && | 328 if (source.length >= 3 && |
329 %_StringCharCodeAt(regexp, 0) == 46 && // '.' | 329 %_StringCharCodeAt(source, 0) == 46 && // '.' |
330 %_StringCharCodeAt(regexp, 1) == 42 && // '*' | 330 %_StringCharCodeAt(source, 1) == 42 && // '*' |
331 %_StringCharCodeAt(regexp, 2) != 63) { // '?' | 331 %_StringCharCodeAt(source, 2) != 63) { // '?' |
332 regexp = TrimRegExp(regexp); | 332 regexp = TrimRegExp(regexp); |
333 } | 333 } |
334 // matchIndices is either null or the RegExpLastMatchInfo array. | 334 // matchIndices is either null or the RegExpLastMatchInfo array. |
335 var matchIndices = %_RegExpExec(regexp, string, 0, RegExpLastMatchInfo); | 335 var matchIndices = %_RegExpExec(regexp, string, 0, RegExpLastMatchInfo); |
336 if (IS_NULL(matchIndices)) { | 336 if (IS_NULL(matchIndices)) { |
337 this.lastIndex = 0; | 337 this.lastIndex = 0; |
338 return false; | 338 return false; |
339 } | 339 } |
340 return true; | 340 return true; |
341 } | 341 } |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 to.RegExpSubclassExecJS = RegExpSubclassExecJS; | 1237 to.RegExpSubclassExecJS = RegExpSubclassExecJS; |
1238 to.RegExpSubclassMatch = RegExpSubclassMatch; | 1238 to.RegExpSubclassMatch = RegExpSubclassMatch; |
1239 to.RegExpSubclassReplace = RegExpSubclassReplace; | 1239 to.RegExpSubclassReplace = RegExpSubclassReplace; |
1240 to.RegExpSubclassSearch = RegExpSubclassSearch; | 1240 to.RegExpSubclassSearch = RegExpSubclassSearch; |
1241 to.RegExpSubclassSplit = RegExpSubclassSplit; | 1241 to.RegExpSubclassSplit = RegExpSubclassSplit; |
1242 to.RegExpSubclassTest = RegExpSubclassTest; | 1242 to.RegExpSubclassTest = RegExpSubclassTest; |
1243 to.RegExpTest = RegExpTest; | 1243 to.RegExpTest = RegExpTest; |
1244 }); | 1244 }); |
1245 | 1245 |
1246 }) | 1246 }) |
OLD | NEW |