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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 throw MakeTypeError(kCalledOnNonObject, "Error.prototype.toString"); | 1008 throw MakeTypeError(kCalledOnNonObject, "Error.prototype.toString"); |
1009 } | 1009 } |
1010 | 1010 |
1011 return %ErrorToStringRT(this); | 1011 return %ErrorToStringRT(this); |
1012 } | 1012 } |
1013 | 1013 |
1014 utils.InstallFunctions(GlobalError.prototype, DONT_ENUM, | 1014 utils.InstallFunctions(GlobalError.prototype, DONT_ENUM, |
1015 ['toString', ErrorToString]); | 1015 ['toString', ErrorToString]); |
1016 | 1016 |
1017 $errorToString = ErrorToString; | 1017 $errorToString = ErrorToString; |
1018 $getStackTraceLine = GetStackTraceLine; | |
1019 $messageGetPositionInLine = GetPositionInLine; | 1018 $messageGetPositionInLine = GetPositionInLine; |
1020 $messageGetLineNumber = GetLineNumber; | 1019 $messageGetLineNumber = GetLineNumber; |
1021 $messageGetSourceLine = GetSourceLine; | 1020 $messageGetSourceLine = GetSourceLine; |
1022 $noSideEffectToString = NoSideEffectToString; | 1021 $noSideEffectToString = NoSideEffectToString; |
1023 $toDetailString = ToDetailString; | 1022 $toDetailString = ToDetailString; |
1024 | 1023 |
1025 $Error = GlobalError; | 1024 $Error = GlobalError; |
1026 $EvalError = GlobalEvalError; | 1025 $EvalError = GlobalEvalError; |
1027 $RangeError = GlobalRangeError; | 1026 $RangeError = GlobalRangeError; |
1028 $ReferenceError = GlobalReferenceError; | 1027 $ReferenceError = GlobalReferenceError; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 captureStackTrace = function captureStackTrace(obj, cons_opt) { | 1068 captureStackTrace = function captureStackTrace(obj, cons_opt) { |
1070 // Define accessors first, as this may fail and throw. | 1069 // Define accessors first, as this may fail and throw. |
1071 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, | 1070 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, |
1072 set: StackTraceSetter, | 1071 set: StackTraceSetter, |
1073 configurable: true }); | 1072 configurable: true }); |
1074 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); | 1073 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); |
1075 }; | 1074 }; |
1076 | 1075 |
1077 GlobalError.captureStackTrace = captureStackTrace; | 1076 GlobalError.captureStackTrace = captureStackTrace; |
1078 | 1077 |
| 1078 utils.ExportToRuntime(function(to) { |
| 1079 to.GetStackTraceLine = GetStackTraceLine; |
1079 }); | 1080 }); |
| 1081 |
| 1082 }); |
OLD | NEW |