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

Unified Diff: lib/src/source_visitor.dart

Issue 1589823004: Support messages in assert(). (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « lib/src/argument_list_visitor.dart ('k') | test/splitting/statements.stmt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/source_visitor.dart
diff --git a/lib/src/source_visitor.dart b/lib/src/source_visitor.dart
index cbe34484186070983126c260092c860efab0f898..529e420a4eff3d0ec548a0a13bc72b4dc1577ca2 100644
--- a/lib/src/source_visitor.dart
+++ b/lib/src/source_visitor.dart
@@ -161,10 +161,13 @@ class SourceVisitor implements AstVisitor {
visitAssertStatement(AssertStatement node) {
_simpleStatement(node, () {
token(node.assertKeyword);
- token(node.leftParenthesis);
- soloZeroSplit();
- visit(node.condition);
- token(node.rightParenthesis);
+
+ var arguments = [node.condition];
+ if (node.message != null) arguments.add(node.message);
+
+ var visitor = new ArgumentListVisitor.forArguments(
+ this, node.leftParenthesis, node.rightParenthesis, arguments);
+ visitor.visit();
});
}
« no previous file with comments | « lib/src/argument_list_visitor.dart ('k') | test/splitting/statements.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698