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

Unified Diff: pkg/compiler/lib/src/parser/parser.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/node_listener.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/parser.dart
diff --git a/pkg/compiler/lib/src/parser/parser.dart b/pkg/compiler/lib/src/parser/parser.dart
index 68f96bc363c60187aa22cd6313edd5fb5918061f..6ed2657b74a53e158e607f8e2b38a95ab8db671c 100644
--- a/pkg/compiler/lib/src/parser/parser.dart
+++ b/pkg/compiler/lib/src/parser/parser.dart
@@ -2697,10 +2697,20 @@ class Parser {
Token parseAssertStatement(Token token) {
Token assertKeyword = token;
+ Token commaToken = null;
token = expect('assert', token);
- expect('(', token);
- token = parseArguments(token);
- listener.handleAssertStatement(assertKeyword, token);
+ token = expect('(', token);
+ bool old = mayParseFunctionExpressions;
+ mayParseFunctionExpressions = true;
+ token = parseExpression(token);
+ if (optional(',', token)) {
+ commaToken = token;
+ token = token.next;
+ token = parseExpression(token);
+ }
+ token = expect(')', token);
+ mayParseFunctionExpressions = old;
+ listener.handleAssertStatement(assertKeyword, commaToken, token);
return expectSemicolon(token);
}
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698