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 var $errorToString; | 7 var $errorToString; |
8 var $getStackTraceLine; | 8 var $getStackTraceLine; |
9 var $internalErrorSymbol; | 9 var $internalErrorSymbol; |
10 var $messageGetPositionInLine; | 10 var $messageGetPositionInLine; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 var GlobalError; | 75 var GlobalError; |
76 var GlobalTypeError; | 76 var GlobalTypeError; |
77 var GlobalRangeError; | 77 var GlobalRangeError; |
78 var GlobalURIError; | 78 var GlobalURIError; |
79 var GlobalSyntaxError; | 79 var GlobalSyntaxError; |
80 var GlobalReferenceError; | 80 var GlobalReferenceError; |
81 var GlobalEvalError; | 81 var GlobalEvalError; |
82 | 82 |
83 | 83 |
84 function NoSideEffectsObjectToString() { | 84 function NoSideEffectsObjectToString() { |
85 if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) return "[object Undefined]"; | 85 if (IS_UNDEFINED(this)) return "[object Undefined]"; |
86 if (IS_NULL(this)) return "[object Null]"; | 86 if (IS_NULL(this)) return "[object Null]"; |
87 return "[object " + %_ClassOf(TO_OBJECT(this)) + "]"; | 87 return "[object " + %_ClassOf(TO_OBJECT(this)) + "]"; |
88 } | 88 } |
89 | 89 |
90 | 90 |
91 function NoSideEffectToString(obj) { | 91 function NoSideEffectToString(obj) { |
92 if (IS_STRING(obj)) return obj; | 92 if (IS_STRING(obj)) return obj; |
93 if (IS_NUMBER(obj)) return %_NumberToString(obj); | 93 if (IS_NUMBER(obj)) return %_NumberToString(obj); |
94 if (IS_BOOLEAN(obj)) return obj ? 'true' : 'false'; | 94 if (IS_BOOLEAN(obj)) return obj ? 'true' : 'false'; |
95 if (IS_UNDEFINED(obj)) return 'undefined'; | 95 if (IS_UNDEFINED(obj)) return 'undefined'; |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // Define accessors first, as this may fail and throw. | 1070 // Define accessors first, as this may fail and throw. |
1071 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, | 1071 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, |
1072 set: StackTraceSetter, | 1072 set: StackTraceSetter, |
1073 configurable: true }); | 1073 configurable: true }); |
1074 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); | 1074 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); |
1075 }; | 1075 }; |
1076 | 1076 |
1077 GlobalError.captureStackTrace = captureStackTrace; | 1077 GlobalError.captureStackTrace = captureStackTrace; |
1078 | 1078 |
1079 }); | 1079 }); |
OLD | NEW |