| 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 28 matching lines...) Expand all Loading... |
| 39 2, // REGEXP_NUMBER_OF_CAPTURES | 39 2, // REGEXP_NUMBER_OF_CAPTURES |
| 40 "", // Last subject. | 40 "", // Last subject. |
| 41 UNDEFINED, // Last input - settable with RegExpSetInput. | 41 UNDEFINED, // Last input - settable with RegExpSetInput. |
| 42 0, // REGEXP_FIRST_CAPTURE + 0 | 42 0, // REGEXP_FIRST_CAPTURE + 0 |
| 43 0 // REGEXP_FIRST_CAPTURE + 1 | 43 0 // REGEXP_FIRST_CAPTURE + 1 |
| 44 ); | 44 ); |
| 45 | 45 |
| 46 // ------------------------------------------------------------------- | 46 // ------------------------------------------------------------------- |
| 47 | 47 |
| 48 function IsRegExp(o) { | 48 function IsRegExp(o) { |
| 49 if (!IS_SPEC_OBJECT(o)) return false; | 49 if (!IS_RECEIVER(o)) return false; |
| 50 var is_regexp = o[matchSymbol]; | 50 var is_regexp = o[matchSymbol]; |
| 51 if (!IS_UNDEFINED(is_regexp)) return TO_BOOLEAN(is_regexp); | 51 if (!IS_UNDEFINED(is_regexp)) return TO_BOOLEAN(is_regexp); |
| 52 return IS_REGEXP(o); | 52 return IS_REGEXP(o); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 // ES6 section 21.2.3.2.2 | 56 // ES6 section 21.2.3.2.2 |
| 57 function RegExpInitialize(object, pattern, flags) { | 57 function RegExpInitialize(object, pattern, flags) { |
| 58 pattern = IS_UNDEFINED(pattern) ? '' : TO_STRING(pattern); | 58 pattern = IS_UNDEFINED(pattern) ? '' : TO_STRING(pattern); |
| 59 flags = IS_UNDEFINED(flags) ? '' : TO_STRING(flags); | 59 flags = IS_UNDEFINED(flags) ? '' : TO_STRING(flags); |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 // Exports | 563 // Exports |
| 564 | 564 |
| 565 utils.Export(function(to) { | 565 utils.Export(function(to) { |
| 566 to.RegExpExec = DoRegExpExec; | 566 to.RegExpExec = DoRegExpExec; |
| 567 to.RegExpExecNoTests = RegExpExecNoTests; | 567 to.RegExpExecNoTests = RegExpExecNoTests; |
| 568 to.RegExpLastMatchInfo = RegExpLastMatchInfo; | 568 to.RegExpLastMatchInfo = RegExpLastMatchInfo; |
| 569 to.RegExpTest = RegExpTest; | 569 to.RegExpTest = RegExpTest; |
| 570 }); | 570 }); |
| 571 | 571 |
| 572 }) | 572 }) |
| OLD | NEW |