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 $formatMessage; | 8 var $formatMessage; |
9 var $getStackTraceLine; | 9 var $getStackTraceLine; |
10 var $messageGetPositionInLine; | 10 var $messageGetPositionInLine; |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 | 1002 |
1003 | 1003 |
1004 function GetStackFrames(raw_stack) { | 1004 function GetStackFrames(raw_stack) { |
1005 var frames = new InternalArray(); | 1005 var frames = new InternalArray(); |
1006 var sloppy_frames = raw_stack[0]; | 1006 var sloppy_frames = raw_stack[0]; |
1007 for (var i = 1; i < raw_stack.length; i += 4) { | 1007 for (var i = 1; i < raw_stack.length; i += 4) { |
1008 var recv = raw_stack[i]; | 1008 var recv = raw_stack[i]; |
1009 var fun = raw_stack[i + 1]; | 1009 var fun = raw_stack[i + 1]; |
1010 var code = raw_stack[i + 2]; | 1010 var code = raw_stack[i + 2]; |
1011 var pc = raw_stack[i + 3]; | 1011 var pc = raw_stack[i + 3]; |
1012 var pos = %FunctionGetPositionForOffset(code, pc); | 1012 var pos = %_IsSmi(code) ? code : %FunctionGetPositionForOffset(code, pc); |
1013 sloppy_frames--; | 1013 sloppy_frames--; |
1014 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); | 1014 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); |
1015 } | 1015 } |
1016 return frames; | 1016 return frames; |
1017 } | 1017 } |
1018 | 1018 |
1019 | 1019 |
1020 // Flag to prevent recursive call of Error.prepareStackTrace. | 1020 // Flag to prevent recursive call of Error.prepareStackTrace. |
1021 var formatting_custom_stack_trace = false; | 1021 var formatting_custom_stack_trace = false; |
1022 | 1022 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 return MakeGenericError(GlobalTypeError, type, [arg]); | 1304 return MakeGenericError(GlobalTypeError, type, [arg]); |
1305 } | 1305 } |
1306 | 1306 |
1307 //Boilerplate for exceptions for stack overflows. Used from | 1307 //Boilerplate for exceptions for stack overflows. Used from |
1308 //Isolate::StackOverflow(). | 1308 //Isolate::StackOverflow(). |
1309 $stackOverflowBoilerplate = MakeRangeError(kStackOverflow); | 1309 $stackOverflowBoilerplate = MakeRangeError(kStackOverflow); |
1310 %DefineAccessorPropertyUnchecked($stackOverflowBoilerplate, 'stack', | 1310 %DefineAccessorPropertyUnchecked($stackOverflowBoilerplate, 'stack', |
1311 StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1311 StackTraceGetter, StackTraceSetter, DONT_ENUM); |
1312 | 1312 |
1313 })(); | 1313 })(); |
OLD | NEW |