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

Unified Diff: pkg/compiler/lib/src/typechecker.dart

Issue 1325843003: Add optional message to assert in Dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Reintroduce assertHelper for asserts without messages. 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
Index: pkg/compiler/lib/src/typechecker.dart
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index 74b9659d39e1bf3c60dc4a426305e3ca51a394d2..3b075b0d0692b6b621f8584f77e0d489673cb870 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -602,6 +602,12 @@ class TypeCheckerVisitor extends Visitor<DartType> {
return type;
}
+ DartType visitAssert(Assert node) {
+ analyze(node.condition);
+ if (node.hasMessage) analyze(node.message);
+ return const StatementType();
+ }
+
DartType visitBlock(Block node) {
return analyze(node.statements);
}
@@ -1170,10 +1176,6 @@ class TypeCheckerVisitor extends Visitor<DartType> {
}
DartType visitSend(Send node) {
- if (elements.isAssert(node)) {
- return analyzeInvocation(node, const AssertAccess());
- }
-
Element element = elements[node];
if (element != null && element.isConstructor) {

Powered by Google App Engine
This is Rietveld 408576698