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; | |
8 var MakeError; | 7 var MakeError; |
9 var MakeEvalError; | 8 var MakeEvalError; |
10 var MakeRangeError; | 9 var MakeRangeError; |
11 var MakeReferenceError; | 10 var MakeReferenceError; |
12 var MakeSyntaxError; | 11 var MakeSyntaxError; |
13 var MakeTypeError; | 12 var MakeTypeError; |
14 var MakeURIError; | 13 var MakeURIError; |
15 | 14 |
16 (function(global, utils) { | 15 (function(global, utils) { |
17 | 16 |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 if (!IS_SPEC_OBJECT(this)) { | 975 if (!IS_SPEC_OBJECT(this)) { |
977 throw MakeTypeError(kCalledOnNonObject, "Error.prototype.toString"); | 976 throw MakeTypeError(kCalledOnNonObject, "Error.prototype.toString"); |
978 } | 977 } |
979 | 978 |
980 return %ErrorToStringRT(this); | 979 return %ErrorToStringRT(this); |
981 } | 980 } |
982 | 981 |
983 utils.InstallFunctions(GlobalError.prototype, DONT_ENUM, | 982 utils.InstallFunctions(GlobalError.prototype, DONT_ENUM, |
984 ['toString', ErrorToString]); | 983 ['toString', ErrorToString]); |
985 | 984 |
986 $errorToString = ErrorToString; | |
987 | |
988 MakeError = function(type, arg0, arg1, arg2) { | 985 MakeError = function(type, arg0, arg1, arg2) { |
989 return MakeGenericError(GlobalError, type, arg0, arg1, arg2); | 986 return MakeGenericError(GlobalError, type, arg0, arg1, arg2); |
990 } | 987 } |
991 | 988 |
992 MakeRangeError = function(type, arg0, arg1, arg2) { | 989 MakeRangeError = function(type, arg0, arg1, arg2) { |
993 return MakeGenericError(GlobalRangeError, type, arg0, arg1, arg2); | 990 return MakeGenericError(GlobalRangeError, type, arg0, arg1, arg2); |
994 } | 991 } |
995 | 992 |
996 MakeSyntaxError = function(type, arg0, arg1, arg2) { | 993 MakeSyntaxError = function(type, arg0, arg1, arg2) { |
997 return MakeGenericError(GlobalSyntaxError, type, arg0, arg1, arg2); | 994 return MakeGenericError(GlobalSyntaxError, type, arg0, arg1, arg2); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 "no_side_effect_to_string_fun", NoSideEffectToString, | 1033 "no_side_effect_to_string_fun", NoSideEffectToString, |
1037 "range_error_function", GlobalRangeError, | 1034 "range_error_function", GlobalRangeError, |
1038 "reference_error_function", GlobalReferenceError, | 1035 "reference_error_function", GlobalReferenceError, |
1039 "stack_overflow_boilerplate", StackOverflowBoilerplate, | 1036 "stack_overflow_boilerplate", StackOverflowBoilerplate, |
1040 "syntax_error_function", GlobalSyntaxError, | 1037 "syntax_error_function", GlobalSyntaxError, |
1041 "to_detail_string_fun", ToDetailString, | 1038 "to_detail_string_fun", ToDetailString, |
1042 "type_error_function", GlobalTypeError, | 1039 "type_error_function", GlobalTypeError, |
1043 "uri_error_function", GlobalURIError, | 1040 "uri_error_function", GlobalURIError, |
1044 ]); | 1041 ]); |
1045 | 1042 |
| 1043 utils.Export(function(to) { |
| 1044 to.ErrorToString = ErrorToString; |
1046 }); | 1045 }); |
| 1046 |
| 1047 }); |
OLD | NEW |