| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index 0d978e94f3d66cb5e9771dde0882a18b10c99020..4059f6beefb88fbfd5ef09c20506422ac25e8569 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -9221,9 +9221,18 @@ 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;
|
| + if (Scanner::IsIdentStartChar(source.CharAt(offset))) {
|
| + for (intptr_t i = offset + 1;
|
| + i < source.Length() && Scanner::IsIdentChar(source.CharAt(i));
|
| + ++i) {
|
| + ++*token_len;
|
| + }
|
| + }
|
| }
|
| return;
|
| }
|
|
|