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

Unified Diff: pkg/compiler/lib/src/tree/unparser.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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/tree/unparser.dart
diff --git a/pkg/compiler/lib/src/tree/unparser.dart b/pkg/compiler/lib/src/tree/unparser.dart
index fd00ba31403da964a071ded52d16b0a3c7bc27de..f5a67c92a0d6d46fbe53abc939c2d5c1e86b4887 100644
--- a/pkg/compiler/lib/src/tree/unparser.dart
+++ b/pkg/compiler/lib/src/tree/unparser.dart
@@ -58,6 +58,18 @@ class Unparser extends Indentation implements Visitor {
if (node != null) node.accept(this);
}
+ visitAssert(Assert node) {
+ write(node.assertToken.value);
+ write('(');
+ visit(node.condition);
+ if (node.hasMessage) {
+ write(',');
+ space();
+ visit(node.message);
+ }
+ write(');');
+ }
+
visitBlock(Block node) => unparseBlockStatements(node.statements);
unparseBlockStatements(NodeList statements) {

Powered by Google App Engine
This is Rietveld 408576698