| 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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 | 772 |
| 773 | 773 |
| 774 // Returns the offset of the given position within the containing | 774 // Returns the offset of the given position within the containing |
| 775 // line. | 775 // line. |
| 776 function GetPositionInLine(message) { | 776 function GetPositionInLine(message) { |
| 777 var script = %MessageGetScript(message); | 777 var script = %MessageGetScript(message); |
| 778 var start_position = %MessageGetStartPosition(message); | 778 var start_position = %MessageGetStartPosition(message); |
| 779 var location = script.locationFromPosition(start_position, false); | 779 var location = script.locationFromPosition(start_position, false); |
| 780 if (location == null) return -1; | 780 if (location == null) return -1; |
| 781 location.restrict(); | 781 location.restrict(); |
| 782 return start_position - location.start; | 782 return location.column; |
| 783 } | 783 } |
| 784 | 784 |
| 785 | 785 |
| 786 function GetStackTraceLine(recv, fun, pos, isGlobal) { | 786 function GetStackTraceLine(recv, fun, pos, isGlobal) { |
| 787 return new CallSite(recv, fun, pos, false).toString(); | 787 return new CallSite(recv, fun, pos, false).toString(); |
| 788 } | 788 } |
| 789 | 789 |
| 790 // ---------------------------------------------------------------------------- | 790 // ---------------------------------------------------------------------------- |
| 791 // Error implementation | 791 // Error implementation |
| 792 | 792 |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1327 function SetUpStackOverflowBoilerplate() { | 1327 function SetUpStackOverflowBoilerplate() { |
| 1328 var boilerplate = MakeRangeError('stack_overflow', []); | 1328 var boilerplate = MakeRangeError('stack_overflow', []); |
| 1329 | 1329 |
| 1330 %DefineAccessorPropertyUnchecked( | 1330 %DefineAccessorPropertyUnchecked( |
| 1331 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1331 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
| 1332 | 1332 |
| 1333 return boilerplate; | 1333 return boilerplate; |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1336 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
| OLD | NEW |