| 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 // ------------------------------------------------------------------- | 5 // ------------------------------------------------------------------- |
| 6 | 6 |
| 7 (function(global, utils) { | 7 (function(global, utils) { |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| 11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
| 12 // Imports | 12 // Imports |
| 13 | 13 |
| 14 var ArrayJoin; | 14 var ArrayJoin; |
| 15 var Bool16x8ToString; | 15 var Bool16x8ToString; |
| 16 var Bool32x4ToString; | 16 var Bool32x4ToString; |
| 17 var Bool8x16ToString; | 17 var Bool8x16ToString; |
| 18 var callSiteReceiverSymbol = | 18 var callSiteReceiverSymbol = |
| 19 utils.ImportNow("call_site_receiver_symbol"); | 19 utils.ImportNow("call_site_receiver_symbol"); |
| 20 var callSiteFunctionSymbol = | 20 var callSiteFunctionSymbol = |
| 21 utils.ImportNow("call_site_function_symbol"); | 21 utils.ImportNow("call_site_function_symbol"); |
| 22 var callSitePositionSymbol = | 22 var callSitePositionSymbol = |
| 23 utils.ImportNow("call_site_position_symbol"); | 23 utils.ImportNow("call_site_position_symbol"); |
| 24 var callSiteStrictSymbol = | 24 var callSiteStrictSymbol = |
| 25 utils.ImportNow("call_site_strict_symbol"); | 25 utils.ImportNow("call_site_strict_symbol"); |
| 26 var FLAG_harmony_tostring; | |
| 27 var Float32x4ToString; | 26 var Float32x4ToString; |
| 28 var formattedStackTraceSymbol = | 27 var formattedStackTraceSymbol = |
| 29 utils.ImportNow("formatted_stack_trace_symbol"); | 28 utils.ImportNow("formatted_stack_trace_symbol"); |
| 30 var GlobalObject = global.Object; | 29 var GlobalObject = global.Object; |
| 31 var Int16x8ToString; | 30 var Int16x8ToString; |
| 32 var Int32x4ToString; | 31 var Int32x4ToString; |
| 33 var Int8x16ToString; | 32 var Int8x16ToString; |
| 34 var InternalArray = utils.InternalArray; | 33 var InternalArray = utils.InternalArray; |
| 35 var internalErrorSymbol = utils.ImportNow("internal_error_symbol"); | 34 var internalErrorSymbol = utils.ImportNow("internal_error_symbol"); |
| 36 var ObjectDefineProperty; | 35 var ObjectDefineProperty; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 60 ObjectHasOwnProperty = from.ObjectHasOwnProperty; | 59 ObjectHasOwnProperty = from.ObjectHasOwnProperty; |
| 61 StringCharAt = from.StringCharAt; | 60 StringCharAt = from.StringCharAt; |
| 62 StringIndexOf = from.StringIndexOf; | 61 StringIndexOf = from.StringIndexOf; |
| 63 StringSubstring = from.StringSubstring; | 62 StringSubstring = from.StringSubstring; |
| 64 SymbolToString = from.SymbolToString; | 63 SymbolToString = from.SymbolToString; |
| 65 Uint16x8ToString = from.Uint16x8ToString; | 64 Uint16x8ToString = from.Uint16x8ToString; |
| 66 Uint32x4ToString = from.Uint32x4ToString; | 65 Uint32x4ToString = from.Uint32x4ToString; |
| 67 Uint8x16ToString = from.Uint8x16ToString; | 66 Uint8x16ToString = from.Uint8x16ToString; |
| 68 }); | 67 }); |
| 69 | 68 |
| 70 utils.ImportFromExperimental(function(from) { | |
| 71 FLAG_harmony_tostring = from.FLAG_harmony_tostring; | |
| 72 }); | |
| 73 | |
| 74 // ------------------------------------------------------------------- | 69 // ------------------------------------------------------------------- |
| 75 | 70 |
| 76 var GlobalError; | 71 var GlobalError; |
| 77 var GlobalTypeError; | 72 var GlobalTypeError; |
| 78 var GlobalRangeError; | 73 var GlobalRangeError; |
| 79 var GlobalURIError; | 74 var GlobalURIError; |
| 80 var GlobalSyntaxError; | 75 var GlobalSyntaxError; |
| 81 var GlobalReferenceError; | 76 var GlobalReferenceError; |
| 82 var GlobalEvalError; | 77 var GlobalEvalError; |
| 83 | 78 |
| 84 | 79 |
| 85 function NoSideEffectsObjectToString() { | 80 function NoSideEffectsObjectToString() { |
| 86 if (IS_UNDEFINED(this)) return "[object Undefined]"; | 81 if (IS_UNDEFINED(this)) return "[object Undefined]"; |
| 87 if (IS_NULL(this)) return "[object Null]"; | 82 if (IS_NULL(this)) return "[object Null]"; |
| 88 var O = TO_OBJECT(this); | 83 var O = TO_OBJECT(this); |
| 89 var builtinTag = %_ClassOf(O); | 84 var builtinTag = %_ClassOf(O); |
| 90 var tag; | 85 var tag = %GetDataProperty(O, toStringTagSymbol); |
| 91 if (FLAG_harmony_tostring) { | 86 if (!IS_STRING(tag)) { |
| 92 tag = %GetDataProperty(O, toStringTagSymbol); | |
| 93 if (!IS_STRING(tag)) { | |
| 94 tag = builtinTag; | |
| 95 } | |
| 96 } else { | |
| 97 tag = builtinTag; | 87 tag = builtinTag; |
| 98 } | 88 } |
| 99 return `[object ${tag}]`; | 89 return `[object ${tag}]`; |
| 100 } | 90 } |
| 101 | 91 |
| 102 function IsErrorObject(obj) { | 92 function IsErrorObject(obj) { |
| 103 return HAS_PRIVATE(obj, stackTraceSymbol); | 93 return HAS_PRIVATE(obj, stackTraceSymbol); |
| 104 } | 94 } |
| 105 | 95 |
| 106 function NoSideEffectsErrorToString() { | 96 function NoSideEffectsErrorToString() { |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 utils.Export(function(to) { | 997 utils.Export(function(to) { |
| 1008 to.ErrorToString = ErrorToString; | 998 to.ErrorToString = ErrorToString; |
| 1009 to.MakeError = MakeError; | 999 to.MakeError = MakeError; |
| 1010 to.MakeRangeError = MakeRangeError; | 1000 to.MakeRangeError = MakeRangeError; |
| 1011 to.MakeSyntaxError = MakeSyntaxError; | 1001 to.MakeSyntaxError = MakeSyntaxError; |
| 1012 to.MakeTypeError = MakeTypeError; | 1002 to.MakeTypeError = MakeTypeError; |
| 1013 to.MakeURIError = MakeURIError; | 1003 to.MakeURIError = MakeURIError; |
| 1014 }); | 1004 }); |
| 1015 | 1005 |
| 1016 }); | 1006 }); |
| OLD | NEW |