Chromium Code Reviews| Index: pkg/compiler/lib/src/io/position_information.dart |
| diff --git a/pkg/compiler/lib/src/io/position_information.dart b/pkg/compiler/lib/src/io/position_information.dart |
| index 416d7ea2c1a4e6c8d328c49cb84b2a3ed7e3c3bb..f7cdf7b6994c824d1acb6ee286f874b5ae3fd5f7 100644 |
| --- a/pkg/compiler/lib/src/io/position_information.dart |
| +++ b/pkg/compiler/lib/src/io/position_information.dart |
| @@ -172,7 +172,24 @@ class PositionSourceInformationBuilder implements SourceInformationBuilder { |
| SourceInformation buildLoop(Node node) => buildBegin(node); |
| @override |
| - SourceInformation buildGet(Node node) => buildBegin(node); |
| + SourceInformation buildGet(Node node) { |
| + Node left = node; |
| + Node right = node; |
| + Send send = node.asSend(); |
| + if (send != null) { |
| + right = send.selector; |
| + } |
| + // For a read access like `a.b` the first source locations points to the |
| + // left-most part of the access, `a` in the example, and the second source |
| + // location points to the 'name' of accessed property, `b` in the |
| + // example. The latter is needed if when both `a` and `b` are compiled into |
|
karlklose
2015/07/22 09:06:48
'if' or 'when' - you decide.
Johnni Winther
2015/07/22 10:50:05
Done.
|
| + // JavaScript invocations. |
| + return new PositionSourceInformation( |
| + new OffsetSourceLocation( |
| + sourceFile, left.getBeginToken().charOffset, name), |
| + new OffsetSourceLocation( |
| + sourceFile, right.getBeginToken().charOffset, name)); |
| + } |
| @override |
| SourceInformation buildCall(Node receiver, Node call) { |