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

Unified Diff: pkg/compiler/lib/src/inferrer/inferrer_visitor.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
Index: pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
index 482eb115544bffe517a66fa2329e014287e7354f..08fa94517b41c3e90569a3ab0e8f72093c5fb3e4 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
@@ -758,6 +758,14 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
T handleDynamicInvoke(Send node);
+ T visitAssert(Assert node) {
+ // Avoid pollution from assert statement unless enabled.
+ if (compiler.enableUserAssertions) {
+ super.visitAssert(node);
+ }
+ return null;
+ }
+
T visitAsyncForIn(AsyncForIn node);
T visitSyncForIn(SyncForIn node);
@@ -796,17 +804,6 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
return types.dynamicType;
}
- @override
- T visitAssert(Send node, Node expression, _) {
- if (!compiler.enableUserAssertions) {
- return types.nullType;
- }
- return handleAssert(node, expression);
- }
-
- /// Handle an enabled assertion of [expression].
- T handleAssert(Send node, Node expression);
-
T visitNode(Node node) {
return node.visitChildren(this);
}
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698