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

Unified Diff: runtime/vm/parser.cc

Issue 36323003: - Ensure that the token stream from generated source matches the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 28974)
+++ runtime/vm/parser.cc (working copy)
@@ -7099,11 +7099,21 @@
if (token_pos >= 0) {
intptr_t line, column;
script.GetTokenLocation(token_pos, &line, &column);
- result = String::NewFormatted("'%s': %s: line %" Pd " pos %" Pd ": ",
- script_url.ToCString(),
- message_header,
- line,
- column);
+ // Only report the line position if we have the original source. We still
+ // need to get a valid column so that we can report the ^ mark below the
+ // snippet.
+ if (script.HasSource()) {
+ result = String::NewFormatted("'%s': %s: line %" Pd " pos %" Pd ": ",
+ script_url.ToCString(),
+ message_header,
+ line,
+ column);
+ } else {
+ result = String::NewFormatted("'%s': %s: line %" Pd ": ",
+ script_url.ToCString(),
+ message_header,
+ line);
+ }
// Append the formatted error or warning message.
result = String::Concat(result, msg);
const String& new_line = String::Handle(String::New("\n"));
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/scanner.h » ('j') | runtime/vm/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698