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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (IS_REGEXP(pattern)) { | 102 if (IS_REGEXP(pattern)) { |
103 if (IS_UNDEFINED(flags)) flags = PatternFlags(pattern); | 103 if (IS_UNDEFINED(flags)) flags = PatternFlags(pattern); |
104 pattern = REGEXP_SOURCE(pattern); | 104 pattern = REGEXP_SOURCE(pattern); |
105 | 105 |
106 } else if (pattern_is_regexp) { | 106 } else if (pattern_is_regexp) { |
107 var input_pattern = pattern; | 107 var input_pattern = pattern; |
108 pattern = pattern.source; | 108 pattern = pattern.source; |
109 if (IS_UNDEFINED(flags)) flags = input_pattern.flags; | 109 if (IS_UNDEFINED(flags)) flags = input_pattern.flags; |
110 } | 110 } |
111 | 111 |
112 var object = %NewObject(GlobalRegExp, newtarget); | 112 var object = %_NewObject(GlobalRegExp, newtarget); |
113 return RegExpInitialize(object, pattern, flags); | 113 return RegExpInitialize(object, pattern, flags); |
114 } | 114 } |
115 | 115 |
116 | 116 |
117 // ES#sec-regexp.prototype.compile RegExp.prototype.compile (pattern, flags) | 117 // ES#sec-regexp.prototype.compile RegExp.prototype.compile (pattern, flags) |
118 function RegExpCompileJS(pattern, flags) { | 118 function RegExpCompileJS(pattern, flags) { |
119 if (!IS_REGEXP(this)) { | 119 if (!IS_REGEXP(this)) { |
120 throw MakeTypeError(kIncompatibleMethodReceiver, | 120 throw MakeTypeError(kIncompatibleMethodReceiver, |
121 "RegExp.prototype.compile", this); | 121 "RegExp.prototype.compile", this); |
122 } | 122 } |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 to.RegExpSubclassExecJS = RegExpSubclassExecJS; | 1247 to.RegExpSubclassExecJS = RegExpSubclassExecJS; |
1248 to.RegExpSubclassMatch = RegExpSubclassMatch; | 1248 to.RegExpSubclassMatch = RegExpSubclassMatch; |
1249 to.RegExpSubclassReplace = RegExpSubclassReplace; | 1249 to.RegExpSubclassReplace = RegExpSubclassReplace; |
1250 to.RegExpSubclassSearch = RegExpSubclassSearch; | 1250 to.RegExpSubclassSearch = RegExpSubclassSearch; |
1251 to.RegExpSubclassSplit = RegExpSubclassSplit; | 1251 to.RegExpSubclassSplit = RegExpSubclassSplit; |
1252 to.RegExpSubclassTest = RegExpSubclassTest; | 1252 to.RegExpSubclassTest = RegExpSubclassTest; |
1253 to.RegExpTest = RegExpTest; | 1253 to.RegExpTest = RegExpTest; |
1254 }); | 1254 }); |
1255 | 1255 |
1256 }) | 1256 }) |
OLD | NEW |