| 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 27 matching lines...) Expand all Loading... |
| 38 2, // REGEXP_NUMBER_OF_CAPTURES | 38 2, // REGEXP_NUMBER_OF_CAPTURES |
| 39 "", // Last subject. | 39 "", // Last subject. |
| 40 UNDEFINED, // Last input - settable with RegExpSetInput. | 40 UNDEFINED, // Last input - settable with RegExpSetInput. |
| 41 0, // REGEXP_FIRST_CAPTURE + 0 | 41 0, // REGEXP_FIRST_CAPTURE + 0 |
| 42 0 // REGEXP_FIRST_CAPTURE + 1 | 42 0 // REGEXP_FIRST_CAPTURE + 1 |
| 43 ); | 43 ); |
| 44 | 44 |
| 45 // ------------------------------------------------------------------- | 45 // ------------------------------------------------------------------- |
| 46 | 46 |
| 47 function IsRegExp(o) { | 47 function IsRegExp(o) { |
| 48 if (!IS_OBJECT(o)) return false; | 48 if (!IS_SPEC_OBJECT(o)) return false; |
| 49 var is_regexp = o[matchSymbol]; | 49 var is_regexp = o[matchSymbol]; |
| 50 if (!IS_UNDEFINED(is_regexp)) return TO_BOOLEAN(is_regexp); | 50 if (!IS_UNDEFINED(is_regexp)) return TO_BOOLEAN(is_regexp); |
| 51 return IS_REGEXP(o); | 51 return IS_REGEXP(o); |
| 52 } | 52 } |
| 53 | 53 |
| 54 | 54 |
| 55 // ES6 section 21.2.3.2.2 | 55 // ES6 section 21.2.3.2.2 |
| 56 function RegExpInitialize(object, pattern, flags) { | 56 function RegExpInitialize(object, pattern, flags) { |
| 57 pattern = IS_UNDEFINED(pattern) ? '' : TO_STRING(pattern); | 57 pattern = IS_UNDEFINED(pattern) ? '' : TO_STRING(pattern); |
| 58 flags = IS_UNDEFINED(flags) ? '' : TO_STRING(flags); | 58 flags = IS_UNDEFINED(flags) ? '' : TO_STRING(flags); |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 // Exports | 532 // Exports |
| 533 | 533 |
| 534 utils.Export(function(to) { | 534 utils.Export(function(to) { |
| 535 to.RegExpExec = DoRegExpExec; | 535 to.RegExpExec = DoRegExpExec; |
| 536 to.RegExpExecNoTests = RegExpExecNoTests; | 536 to.RegExpExecNoTests = RegExpExecNoTests; |
| 537 to.RegExpLastMatchInfo = RegExpLastMatchInfo; | 537 to.RegExpLastMatchInfo = RegExpLastMatchInfo; |
| 538 to.RegExpTest = RegExpTest; | 538 to.RegExpTest = RegExpTest; |
| 539 }); | 539 }); |
| 540 | 540 |
| 541 }) | 541 }) |
| OLD | NEW |