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; |
11 var $messageGetLineNumber; | 11 var $messageGetLineNumber; |
12 var $messageGetSourceLine; | 12 var $messageGetSourceLine; |
13 var $noSideEffectToString; | |
14 var $stackOverflowBoilerplate; | 13 var $stackOverflowBoilerplate; |
15 var $stackTraceSymbol; | 14 var $stackTraceSymbol; |
16 var $toDetailString; | |
17 var $Error; | |
18 var $EvalError; | |
19 var $RangeError; | |
20 var $ReferenceError; | |
21 var $SyntaxError; | |
22 var $TypeError; | |
23 var $URIError; | |
24 var MakeError; | 15 var MakeError; |
25 var MakeEvalError; | 16 var MakeEvalError; |
26 var MakeRangeError; | 17 var MakeRangeError; |
27 var MakeReferenceError; | 18 var MakeReferenceError; |
28 var MakeSyntaxError; | 19 var MakeSyntaxError; |
29 var MakeTypeError; | 20 var MakeTypeError; |
30 var MakeURIError; | 21 var MakeURIError; |
31 | 22 |
32 (function(global, utils) { | 23 (function(global, utils) { |
33 | 24 |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 return %ErrorToStringRT(this); | 1002 return %ErrorToStringRT(this); |
1012 } | 1003 } |
1013 | 1004 |
1014 utils.InstallFunctions(GlobalError.prototype, DONT_ENUM, | 1005 utils.InstallFunctions(GlobalError.prototype, DONT_ENUM, |
1015 ['toString', ErrorToString]); | 1006 ['toString', ErrorToString]); |
1016 | 1007 |
1017 $errorToString = ErrorToString; | 1008 $errorToString = ErrorToString; |
1018 $messageGetPositionInLine = GetPositionInLine; | 1009 $messageGetPositionInLine = GetPositionInLine; |
1019 $messageGetLineNumber = GetLineNumber; | 1010 $messageGetLineNumber = GetLineNumber; |
1020 $messageGetSourceLine = GetSourceLine; | 1011 $messageGetSourceLine = GetSourceLine; |
1021 $noSideEffectToString = NoSideEffectToString; | |
1022 $toDetailString = ToDetailString; | |
1023 | |
1024 $Error = GlobalError; | |
1025 $EvalError = GlobalEvalError; | |
1026 $RangeError = GlobalRangeError; | |
1027 $ReferenceError = GlobalReferenceError; | |
1028 $SyntaxError = GlobalSyntaxError; | |
1029 $TypeError = GlobalTypeError; | |
1030 $URIError = GlobalURIError; | |
1031 | 1012 |
1032 MakeError = function(type, arg0, arg1, arg2) { | 1013 MakeError = function(type, arg0, arg1, arg2) { |
1033 return MakeGenericError(GlobalError, type, arg0, arg1, arg2); | 1014 return MakeGenericError(GlobalError, type, arg0, arg1, arg2); |
1034 } | 1015 } |
1035 | 1016 |
1036 MakeEvalError = function(type, arg0, arg1, arg2) { | 1017 MakeEvalError = function(type, arg0, arg1, arg2) { |
1037 return MakeGenericError(GlobalEvalError, type, arg0, arg1, arg2); | 1018 return MakeGenericError(GlobalEvalError, type, arg0, arg1, arg2); |
1038 } | 1019 } |
1039 | 1020 |
1040 MakeRangeError = function(type, arg0, arg1, arg2) { | 1021 MakeRangeError = function(type, arg0, arg1, arg2) { |
(...skipping 28 matching lines...) Expand all Loading... |
1069 // Define accessors first, as this may fail and throw. | 1050 // Define accessors first, as this may fail and throw. |
1070 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, | 1051 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, |
1071 set: StackTraceSetter, | 1052 set: StackTraceSetter, |
1072 configurable: true }); | 1053 configurable: true }); |
1073 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); | 1054 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); |
1074 }; | 1055 }; |
1075 | 1056 |
1076 GlobalError.captureStackTrace = captureStackTrace; | 1057 GlobalError.captureStackTrace = captureStackTrace; |
1077 | 1058 |
1078 utils.ExportToRuntime(function(to) { | 1059 utils.ExportToRuntime(function(to) { |
| 1060 to.Error = GlobalError; |
| 1061 to.EvalError = GlobalEvalError; |
| 1062 to.RangeError = GlobalRangeError; |
| 1063 to.ReferenceError = GlobalReferenceError; |
| 1064 to.SyntaxError = GlobalSyntaxError; |
| 1065 to.TypeError = GlobalTypeError; |
| 1066 to.URIError = GlobalURIError; |
1079 to.GetStackTraceLine = GetStackTraceLine; | 1067 to.GetStackTraceLine = GetStackTraceLine; |
| 1068 to.NoSideEffectToString = NoSideEffectToString; |
| 1069 to.ToDetailString = ToDetailString; |
1080 }); | 1070 }); |
1081 | 1071 |
1082 }); | 1072 }); |
OLD | NEW |