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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart

Issue 23875033: Do not analyze assert when assertions are disabled. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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: sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart (revision 27549)
+++ sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart (working copy)
@@ -554,7 +554,6 @@
final Element analyzedElement;
final TypeSystem<T> types;
final E inferrer;
- final Compiler compiler;
final Map<TargetElement, List<LocalsHandler<T>>> breaksFor =
new Map<TargetElement, List<LocalsHandler<T>>>();
final Map<TargetElement, List<LocalsHandler>> continuesFor =
@@ -584,10 +583,10 @@
this.types,
Compiler compiler,
[LocalsHandler<T> handler])
- : this.compiler = compiler,
- this.analyzedElement = analyzedElement,
+ : this.analyzedElement = analyzedElement,
this.locals = handler,
- super(compiler.enqueuer.resolution.getCachedElements(analyzedElement)) {
+ super(compiler.enqueuer.resolution.getCachedElements(analyzedElement),
+ compiler) {
if (handler != null) return;
Node node = analyzedElement.parseNode(compiler);
FieldInitializationScope<T> fieldScope =
@@ -615,6 +614,13 @@
T visitFunctionExpression(FunctionExpression node);
+ T visitAssert(Send node) {
+ if (!compiler.enableUserAssertions) {
+ return types.nullType;
+ }
+ return visitStaticSend(node);
+ }
+
T visitNode(Node node) {
node.visitChildren(this);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart ('k') | tests/language/assertion2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698