| 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 kMessages = { | 7 var kMessages = { |
| 8 // Error | 8 // Error |
| 9 cyclic_proto: ["Cyclic __proto__ value"], | 9 cyclic_proto: ["Cyclic __proto__ value"], |
| 10 code_gen_from_strings: ["%0"], | 10 code_gen_from_strings: ["%0"], |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 function ToStringCheckErrorObject(obj) { | 293 function ToStringCheckErrorObject(obj) { |
| 294 if (CanBeSafelyTreatedAsAnErrorObject(obj)) { | 294 if (CanBeSafelyTreatedAsAnErrorObject(obj)) { |
| 295 return %_CallFunction(obj, ErrorToString); | 295 return %_CallFunction(obj, ErrorToString); |
| 296 } else { | 296 } else { |
| 297 return ToString(obj); | 297 return ToString(obj); |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 | 300 |
| 301 | 301 |
| 302 function ToDetailString(obj) { | 302 function ToDetailString(obj) { |
| 303 if (obj != null && IS_OBJECT(obj) && obj.toString === DefaultObjectToString) { | 303 if (obj != null && IS_OBJECT(obj) && obj.toString === ObjectToString) { |
| 304 var constructor = obj.constructor; | 304 var constructor = obj.constructor; |
| 305 if (typeof constructor == "function") { | 305 if (typeof constructor == "function") { |
| 306 var constructorName = constructor.name; | 306 var constructorName = constructor.name; |
| 307 if (IS_STRING(constructorName) && constructorName !== "") { | 307 if (IS_STRING(constructorName) && constructorName !== "") { |
| 308 return "#<" + constructorName + ">"; | 308 return "#<" + constructorName + ">"; |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 return ToStringCheckErrorObject(obj); | 312 return ToStringCheckErrorObject(obj); |
| 313 } | 313 } |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 function SetUpStackOverflowBoilerplate() { | 1281 function SetUpStackOverflowBoilerplate() { |
| 1282 var boilerplate = MakeRangeError('stack_overflow', []); | 1282 var boilerplate = MakeRangeError('stack_overflow', []); |
| 1283 | 1283 |
| 1284 %DefineAccessorPropertyUnchecked( | 1284 %DefineAccessorPropertyUnchecked( |
| 1285 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1285 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
| 1286 | 1286 |
| 1287 return boilerplate; | 1287 return boilerplate; |
| 1288 } | 1288 } |
| 1289 | 1289 |
| 1290 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1290 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
| OLD | NEW |