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

Unified Diff: pkg/compiler/lib/src/typechecker.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 dart2js test 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 cb64d9b989bf2a423348ec1ef0c2cf4df6778326..fb0e3f9e8e7a270a856572f83e49dcb6ea6b4084 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -614,6 +614,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);
}
@@ -1165,10 +1171,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