| 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 // TODO(bmeurer): Move this to toplevel. |
| 40 "use strict"; |
| 39 if (%_ArgumentsLength() == 0) x = ''; | 41 if (%_ArgumentsLength() == 0) x = ''; |
| 40 if (%_IsConstructCall()) { | 42 if (%_IsConstructCall()) { |
| 41 %_SetValueOf(this, TO_STRING_INLINE(x)); | 43 %_SetValueOf(this, TO_STRING_INLINE(x)); |
| 42 } else { | 44 } else { |
| 43 return IS_SYMBOL(x) ? | 45 return IS_SYMBOL(x) ? |
| 44 %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x); | 46 %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x); |
| 45 } | 47 } |
| 46 } | 48 } |
| 47 | 49 |
| 48 | 50 |
| (...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 to.StringLastIndexOf = StringLastIndexOfJS; | 1220 to.StringLastIndexOf = StringLastIndexOfJS; |
| 1219 to.StringMatch = StringMatchJS; | 1221 to.StringMatch = StringMatchJS; |
| 1220 to.StringReplace = StringReplace; | 1222 to.StringReplace = StringReplace; |
| 1221 to.StringSlice = StringSlice; | 1223 to.StringSlice = StringSlice; |
| 1222 to.StringSplit = StringSplitJS; | 1224 to.StringSplit = StringSplitJS; |
| 1223 to.StringSubstr = StringSubstr; | 1225 to.StringSubstr = StringSubstr; |
| 1224 to.StringSubstring = StringSubstring; | 1226 to.StringSubstring = StringSubstring; |
| 1225 }); | 1227 }); |
| 1226 | 1228 |
| 1227 }) | 1229 }) |
| OLD | NEW |