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

Side by Side Diff: pkg/compiler/lib/src/tree/prettyprint.dart

Issue 1325843003: Add optional message to assert in Dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Reintroduce assertHelper for asserts without messages. Created 5 years, 3 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of tree; 5 part of tree;
6 6
7 /** 7 /**
8 * Pretty-prints Node tree in XML-like format. 8 * Pretty-prints Node tree in XML-like format.
9 * 9 *
10 * TODO(smok): Add main() to run from command-line to print out tree for given 10 * TODO(smok): Add main() to run from command-line to print out tree for given
(...skipping 21 matching lines...) Expand all
32 node.accept(p); 32 node.accept(p);
33 return p.sb.toString(); 33 return p.sb.toString();
34 } 34 }
35 35
36 visitNodeWithChildren(Node node, String type) { 36 visitNodeWithChildren(Node node, String type) {
37 openNode(node, type); 37 openNode(node, type);
38 node.visitChildren(this); 38 node.visitChildren(this);
39 closeNode(); 39 closeNode();
40 } 40 }
41 41
42 visitAssert(Assert node) {
43 visitNodeWithChildren(node, "Assert");
44 }
45
42 visitAsyncModifier(AsyncModifier node) { 46 visitAsyncModifier(AsyncModifier node) {
43 openAndCloseNode(node, "AsyncModifier", 47 openAndCloseNode(node, "AsyncModifier",
44 {'asyncToken': node.asyncToken, 48 {'asyncToken': node.asyncToken,
45 'starToken': node.starToken}); 49 'starToken': node.starToken});
46 } 50 }
47 51
48 visitBlock(Block node) { 52 visitBlock(Block node) {
49 visitNodeWithChildren(node, "Block"); 53 visitNodeWithChildren(node, "Block");
50 } 54 }
51 55
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 454 }
451 455
452 visitGotoStatement(GotoStatement node) { 456 visitGotoStatement(GotoStatement node) {
453 unimplemented('visitNode', node: node); 457 unimplemented('visitNode', node: node);
454 } 458 }
455 459
456 unimplemented(String message, {Node node}) { 460 unimplemented(String message, {Node node}) {
457 throw message; 461 throw message;
458 } 462 }
459 } 463 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698