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

Unified Diff: tests/compiler/dart2js/backend_dart/dart_printer_test.dart

Issue 1325843003: Add optional message to assert in Dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comments 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
« pkg/compiler/lib/src/ssa/builder.dart ('K') | « sdk/lib/core/errors.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/backend_dart/dart_printer_test.dart
diff --git a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
index 3ab7e86e720c3b051ce1a4a6c053d0413c1b0b08..1742c23a7adae9fea9bfea99383fdffa95eecc53 100644
--- a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
@@ -583,9 +583,14 @@ class AstBuilder extends Listener {
push(new ForIn(declaredIdentifier, exp, body));
}
- handleAssertStatement(Token assertKeyword, Token semicolonToken) {
+ handleAssertStatement(Token assertKeyword,
+ Token commaToken, Token semicolonToken) {
+ Expression message;
+ if (commaToken != null) message = pop();
Expression exp = pop();
- Expression call = new CallFunction(new Identifier("assert"), [exp]);
+ var arguments = [exp];
+ if (message != null) arguments.add(message);
+ Expression call = new CallFunction(new Identifier("assert"), arguments);
push(new ExpressionStatement(call));
}
« pkg/compiler/lib/src/ssa/builder.dart ('K') | « sdk/lib/core/errors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698