| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Source information system mapping that attempts a semantic mapping between | 5 /// Source information system mapping that attempts a semantic mapping between |
| 6 /// offsets of JavaScript code points to offsets of Dart code points. | 6 /// offsets of JavaScript code points to offsets of Dart code points. |
| 7 | 7 |
| 8 library dart2js.source_information.position; | 8 library dart2js.source_information.position; |
| 9 | 9 |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 // function(){}() new Function("...")() | 646 // function(){}() new Function("...")() |
| 647 // ^ ^ | 647 // ^ ^ |
| 648 return new CallPosition( | 648 return new CallPosition( |
| 649 node.target, CodePositionKind.END, SourcePositionKind.INNER); | 649 node.target, CodePositionKind.END, SourcePositionKind.INNER); |
| 650 } else if (node.target is js.Binary || node.target is js.Call) { | 650 } else if (node.target is js.Binary || node.target is js.Call) { |
| 651 // (0,a)() m()() | 651 // (0,a)() m()() |
| 652 // ^ ^ | 652 // ^ ^ |
| 653 return new CallPosition( | 653 return new CallPosition( |
| 654 node.target, CodePositionKind.END, SourcePositionKind.INNER); | 654 node.target, CodePositionKind.END, SourcePositionKind.INNER); |
| 655 } else { | 655 } else { |
| 656 assert(invariant(NO_LOCATION_SPANNABLE, false, | 656 // TODO(johnniwinther): Maybe remove this assertion. |
| 657 message: "Unexpected property access ${nodeToString(node)}:\n" | 657 assert( |
| 658 false, |
| 659 failedAt( |
| 660 NO_LOCATION_SPANNABLE, |
| 661 "Unexpected property access ${nodeToString(node)}:\n" |
| 658 "${DebugPrinter.prettyPrint(node)}")); | 662 "${DebugPrinter.prettyPrint(node)}")); |
| 659 // Don't know.... | 663 // Don't know.... |
| 660 return new CallPosition( | 664 return new CallPosition( |
| 661 node, CodePositionKind.START, SourcePositionKind.START); | 665 node, CodePositionKind.START, SourcePositionKind.START); |
| 662 } | 666 } |
| 663 } | 667 } |
| 664 } | 668 } |
| 665 | 669 |
| 666 class Offset { | 670 class Offset { |
| 667 /// The offset of the enclosing statement relative to the beginning of the | 671 /// The offset of the enclosing statement relative to the beginning of the |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 | 1340 |
| 1337 @override | 1341 @override |
| 1338 CodePosition operator [](js.Node node) { | 1342 CodePosition operator [](js.Node node) { |
| 1339 CodePosition codePosition = codePositions[node]; | 1343 CodePosition codePosition = codePositions[node]; |
| 1340 if (codePosition == null) { | 1344 if (codePosition == null) { |
| 1341 coverage.registerNodesWithoutOffset(node); | 1345 coverage.registerNodesWithoutOffset(node); |
| 1342 } | 1346 } |
| 1343 return codePosition; | 1347 return codePosition; |
| 1344 } | 1348 } |
| 1345 } | 1349 } |
| OLD | NEW |