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

Unified Diff: pkg/compiler/lib/src/parser/node_listener.dart

Issue 1342213003: Add optional message to assert in Dart2js - continued (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add --assert-message flag 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
« no previous file with comments | « pkg/compiler/lib/src/parser/listener.dart ('k') | pkg/compiler/lib/src/parser/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « pkg/compiler/lib/src/parser/listener.dart ('k') | pkg/compiler/lib/src/parser/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698