Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: src/messages.js

Issue 1021303002: [V8] Fix messages GetPositionInLine method (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698