Index: pkg/compiler/lib/src/parser/node_listener.dart |
diff --git a/pkg/compiler/lib/src/parser/node_listener.dart b/pkg/compiler/lib/src/parser/node_listener.dart |
index 455f53e2282f45682a9b35a420f8c927b9820ed9..d8383f3f9e09addf71c2fba168b7d7159907886e 100644 |
--- a/pkg/compiler/lib/src/parser/node_listener.dart |
+++ b/pkg/compiler/lib/src/parser/node_listener.dart |
@@ -763,11 +763,16 @@ class NodeListener extends ElementListener { |
} |
} |
- void handleAssertStatement(Token assertKeyword, Token semicolonToken) { |
- NodeList arguments = popNode(); |
- Node selector = new Identifier(assertKeyword); |
- Node send = new Send(null, selector, arguments); |
- pushNode(new ExpressionStatement(send, semicolonToken)); |
+ void handleAssertStatement(Token assertKeyword, |
+ Token commaToken, Token semicolonToken) { |
+ Node message; |
+ Node condition; |
+ if (commaToken != null) { |
+ message = popNode(); |
+ } |
+ condition = popNode(); |
+ pushNode(new Assert(assertKeyword, condition, |
+ message, semicolonToken)); |
} |
void endUnnamedFunction(Token token) { |