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 var $regexpLastMatchInfoOverride; | 5 var $regexpLastMatchInfoOverride; |
6 var harmony_regexps = false; | 6 var harmony_regexps = false; |
7 var harmony_unicode_regexps = false; | 7 var harmony_unicode_regexps = false; |
8 | 8 |
9 (function(global, utils) { | 9 (function(global, utils) { |
10 | 10 |
11 %CheckIsBootstrapping(); | 11 %CheckIsBootstrapping(); |
12 | 12 |
13 // ------------------------------------------------------------------- | 13 // ------------------------------------------------------------------- |
14 // Imports | 14 // Imports |
15 | 15 |
16 var GlobalRegExp = global.RegExp; | 16 var GlobalRegExp = global.RegExp; |
17 var InternalPackedArray = utils.InternalPackedArray; | 17 var InternalPackedArray = utils.InternalPackedArray; |
18 | 18 |
| 19 utils.Import(function(from) { |
| 20 ToNumber = from.ToNumber; |
| 21 }); |
| 22 |
19 // ------------------------------------------------------------------- | 23 // ------------------------------------------------------------------- |
20 | 24 |
21 // Property of the builtins object for recording the result of the last | 25 // Property of the builtins object for recording the result of the last |
22 // regexp match. The property RegExpLastMatchInfo includes the matchIndices | 26 // regexp match. The property RegExpLastMatchInfo includes the matchIndices |
23 // array of the last successful regexp match (an array of start/end index | 27 // array of the last successful regexp match (an array of start/end index |
24 // pairs for the match and all the captured substrings), the invariant is | 28 // pairs for the match and all the captured substrings), the invariant is |
25 // that there are at least two capture indeces. The array also contains | 29 // that there are at least two capture indeces. The array also contains |
26 // the subject string for the last successful match. | 30 // the subject string for the last successful match. |
27 var RegExpLastMatchInfo = new InternalPackedArray( | 31 var RegExpLastMatchInfo = new InternalPackedArray( |
28 2, // REGEXP_NUMBER_OF_CAPTURES | 32 2, // REGEXP_NUMBER_OF_CAPTURES |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 // Exports | 448 // Exports |
445 | 449 |
446 utils.Export(function(to) { | 450 utils.Export(function(to) { |
447 to.RegExpExec = DoRegExpExec; | 451 to.RegExpExec = DoRegExpExec; |
448 to.RegExpExecNoTests = RegExpExecNoTests; | 452 to.RegExpExecNoTests = RegExpExecNoTests; |
449 to.RegExpLastMatchInfo = RegExpLastMatchInfo; | 453 to.RegExpLastMatchInfo = RegExpLastMatchInfo; |
450 to.RegExpTest = RegExpTest; | 454 to.RegExpTest = RegExpTest; |
451 }); | 455 }); |
452 | 456 |
453 }) | 457 }) |
OLD | NEW |