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 $stringCharAt; | 5 var $stringCharAt; |
6 var $stringIndexOf; | 6 var $stringIndexOf; |
7 var $stringSubstring; | 7 var $stringSubstring; |
8 | 8 |
9 (function(global, shared, exports) { | 9 (function(global, shared, exports) { |
10 | 10 |
11 %CheckIsBootstrapping(); | 11 %CheckIsBootstrapping(); |
12 | 12 |
13 // ------------------------------------------------------------------- | |
14 // Imports | |
15 | |
16 var GlobalRegExp = global.RegExp; | 13 var GlobalRegExp = global.RegExp; |
17 var GlobalString = global.String; | 14 var GlobalString = global.String; |
18 var InternalArray = shared.InternalArray; | |
19 var InternalPackedArray = shared.InternalPackedArray; | |
20 | 15 |
21 //------------------------------------------------------------------- | 16 //------------------------------------------------------------------- |
22 | 17 |
23 function StringConstructor(x) { | 18 function StringConstructor(x) { |
24 if (%_ArgumentsLength() == 0) x = ''; | 19 if (%_ArgumentsLength() == 0) x = ''; |
25 if (%_IsConstructCall()) { | 20 if (%_IsConstructCall()) { |
26 %_SetValueOf(this, TO_STRING_INLINE(x)); | 21 %_SetValueOf(this, TO_STRING_INLINE(x)); |
27 } else { | 22 } else { |
28 return IS_SYMBOL(x) ? | 23 return IS_SYMBOL(x) ? |
29 %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x); | 24 %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x); |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 "strike", StringStrike, | 1165 "strike", StringStrike, |
1171 "sub", StringSub, | 1166 "sub", StringSub, |
1172 "sup", StringSup | 1167 "sup", StringSup |
1173 ]); | 1168 ]); |
1174 | 1169 |
1175 $stringCharAt = StringCharAtJS; | 1170 $stringCharAt = StringCharAtJS; |
1176 $stringIndexOf = StringIndexOfJS; | 1171 $stringIndexOf = StringIndexOfJS; |
1177 $stringSubstring = StringSubstring; | 1172 $stringSubstring = StringSubstring; |
1178 | 1173 |
1179 }) | 1174 }) |
OLD | NEW |