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

Side by Side Diff: src/messages.js

Issue 1231663007: Takes the script offset into account when obtaining the column of the message. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 $errorToString; 7 var $errorToString;
8 var $getStackTraceLine; 8 var $getStackTraceLine;
9 var $messageGetPositionInLine; 9 var $messageGetPositionInLine;
10 var $messageGetLineNumber; 10 var $messageGetLineNumber;
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 ["script", "from_line", "to_line", "from_position", "to_position"], 535 ["script", "from_line", "to_line", "from_position", "to_position"],
536 ["sourceText", SourceSliceSourceText] 536 ["sourceText", SourceSliceSourceText]
537 ); 537 );
538 538
539 539
540 // Returns the offset of the given position within the containing 540 // Returns the offset of the given position within the containing
541 // line. 541 // line.
542 function GetPositionInLine(message) { 542 function GetPositionInLine(message) {
543 var script = %MessageGetScript(message); 543 var script = %MessageGetScript(message);
544 var start_position = %MessageGetStartPosition(message); 544 var start_position = %MessageGetStartPosition(message);
545 var location = script.locationFromPosition(start_position, false); 545 var location = script.locationFromPosition(start_position, true);
546 if (location == null) return -1; 546 if (location == null) return -1;
547 return location.column; 547 return location.column;
548 } 548 }
549 549
550 550
551 function GetStackTraceLine(recv, fun, pos, isGlobal) { 551 function GetStackTraceLine(recv, fun, pos, isGlobal) {
552 return new CallSite(recv, fun, pos, false).toString(); 552 return new CallSite(recv, fun, pos, false).toString();
553 } 553 }
554 554
555 // ---------------------------------------------------------------------------- 555 // ----------------------------------------------------------------------------
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 // Define accessors first, as this may fail and throw. 1095 // Define accessors first, as this may fail and throw.
1096 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, 1096 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter,
1097 set: StackTraceSetter, 1097 set: StackTraceSetter,
1098 configurable: true }); 1098 configurable: true });
1099 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); 1099 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace);
1100 }; 1100 };
1101 1101
1102 GlobalError.captureStackTrace = captureStackTrace; 1102 GlobalError.captureStackTrace = captureStackTrace;
1103 1103
1104 }); 1104 });
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