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

Unified Diff: runtime/vm/object.cc

Issue 2680303002: Kernel debugging; service tests (Closed)
Patch Set: New failing test Created 3 years, 10 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/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 8df9f9333e007d2bbbb11a80e977f1c75be8093a..a69bd2fd35b9bb85c164a229f7786e602a623fd5 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -9119,9 +9119,19 @@ void Script::GetTokenLocation(TokenPosition token_pos,
*column = offset - smi.Value() + 1;
}
if (token_len != NULL) {
- // We don't explicitly save this data.
- // TODO(jensj): Load the source and attempt to find it from there.
+ // We don't explicitly save this data: Load the source
+ // and find it from there.
+ const String& source = String::Handle(zone, Source());
+ ASSERT(source.Length() >= offset);
*token_len = 1;
+ for (intptr_t i = offset + 1; i < source.Length(); ++i, ++*token_len) {
+ uint16_t c = source.CharAt(i);
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
Kevin Millikin (Google) 2017/02/08 15:37:53 This is Scanner::IsIdentChar(c), isn't it?
jensj 2017/02/13 14:04:17 Yes, but that's private.
+ (c >= '0' && c <= '9') || c == '_' || c == '$') {
+ continue;
+ }
+ break;
+ }
}
return;
}

Powered by Google App Engine
This is Rietveld 408576698