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

Side by Side Diff: pkg/compiler/lib/src/io/position_information.dart

Issue 2898403002: Use failedAt in more places (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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
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 assert(
Johnni Winther 2017/05/24 08:24:52 Add a TODO for me to maybe remove this assertion.
sra1 2017/05/24 17:38:54 Done.
657 message: "Unexpected property access ${nodeToString(node)}:\n" 657 false,
658 failedAt(
659 NO_LOCATION_SPANNABLE,
660 "Unexpected property access ${nodeToString(node)}:\n"
658 "${DebugPrinter.prettyPrint(node)}")); 661 "${DebugPrinter.prettyPrint(node)}"));
659 // Don't know.... 662 // Don't know....
660 return new CallPosition( 663 return new CallPosition(
661 node, CodePositionKind.START, SourcePositionKind.START); 664 node, CodePositionKind.START, SourcePositionKind.START);
662 } 665 }
663 } 666 }
664 } 667 }
665 668
666 class Offset { 669 class Offset {
667 /// The offset of the enclosing statement relative to the beginning of the 670 /// The offset of the enclosing statement relative to the beginning of the
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 1339
1337 @override 1340 @override
1338 CodePosition operator [](js.Node node) { 1341 CodePosition operator [](js.Node node) {
1339 CodePosition codePosition = codePositions[node]; 1342 CodePosition codePosition = codePositions[node];
1340 if (codePosition == null) { 1343 if (codePosition == null) {
1341 coverage.registerNodesWithoutOffset(node); 1344 coverage.registerNodesWithoutOffset(node);
1342 } 1345 }
1343 return codePosition; 1346 return codePosition;
1344 } 1347 }
1345 } 1348 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698