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 18 matching lines...) Expand all Loading... | |
29 RegExpExecNoTests = from.RegExpExecNoTests; | 29 RegExpExecNoTests = from.RegExpExecNoTests; |
30 RegExpLastMatchInfo = from.RegExpLastMatchInfo; | 30 RegExpLastMatchInfo = from.RegExpLastMatchInfo; |
31 SymbolToString = from.SymbolToString; | 31 SymbolToString = from.SymbolToString; |
32 ToNumber = from.ToNumber; | 32 ToNumber = from.ToNumber; |
33 ToString = from.ToString; | 33 ToString = from.ToString; |
34 }); | 34 }); |
35 | 35 |
36 //------------------------------------------------------------------- | 36 //------------------------------------------------------------------- |
37 | 37 |
38 function StringConstructor(x) { | 38 function StringConstructor(x) { |
39 "use strict"; | |
Michael Starzinger
2015/09/15 13:09:58
nit: Let's add a TODO here that this should at som
| |
39 if (%_ArgumentsLength() == 0) x = ''; | 40 if (%_ArgumentsLength() == 0) x = ''; |
40 if (%_IsConstructCall()) { | 41 if (%_IsConstructCall()) { |
41 %_SetValueOf(this, TO_STRING_INLINE(x)); | 42 %_SetValueOf(this, TO_STRING_INLINE(x)); |
42 } else { | 43 } else { |
43 return IS_SYMBOL(x) ? | 44 return IS_SYMBOL(x) ? |
44 %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x); | 45 %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x); |
45 } | 46 } |
46 } | 47 } |
47 | 48 |
48 | 49 |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1218 to.StringLastIndexOf = StringLastIndexOfJS; | 1219 to.StringLastIndexOf = StringLastIndexOfJS; |
1219 to.StringMatch = StringMatchJS; | 1220 to.StringMatch = StringMatchJS; |
1220 to.StringReplace = StringReplace; | 1221 to.StringReplace = StringReplace; |
1221 to.StringSlice = StringSlice; | 1222 to.StringSlice = StringSlice; |
1222 to.StringSplit = StringSplitJS; | 1223 to.StringSplit = StringSplitJS; |
1223 to.StringSubstr = StringSubstr; | 1224 to.StringSubstr = StringSubstr; |
1224 to.StringSubstring = StringSubstring; | 1225 to.StringSubstring = StringSubstring; |
1225 }); | 1226 }); |
1226 | 1227 |
1227 }) | 1228 }) |
OLD | NEW |