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

Unified Diff: runtime/vm/exceptions.cc

Issue 2512653002: Merge of source position information from kernel-sdk. (Closed)
Patch Set: Changed how GetTokenLocation was called back to original to fix failing failing tests. Created 4 years, 1 month 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
« no previous file with comments | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/kernel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index db0d71024c035b5a7a612f799750706c28f8e0f1..f1334b87c5144e706fc074ac3e00fbd2ee7d5d0f 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -506,12 +506,15 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
DartFrameIterator iterator;
const Script& script = Script::Handle(zone, GetCallerScript(&iterator));
- intptr_t line;
+ intptr_t line = -1;
intptr_t column = -1;
- if (script.HasSource()) {
- script.GetTokenLocation(location, &line, &column);
- } else {
- script.GetTokenLocation(location, &line, NULL);
+ ASSERT(!script.IsNull());
+ if (location.IsReal()) {
+ if (script.HasSource() || script.kind() == RawScript::kKernelTag) {
+ script.GetTokenLocation(location, &line, &column);
+ } else {
+ script.GetTokenLocation(location, &line, NULL);
+ }
}
// Initialize '_url', '_line', and '_column' arguments.
args.SetAt(0, String::Handle(zone, script.url()));
« no previous file with comments | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/kernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698