Index: pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart |
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart b/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart |
index 18bab391400d4d79f1b58ba5c603614e0932ff41..27305149f664ee4d896eb843da59b602e064f0fa 100644 |
--- a/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart |
+++ b/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart |
@@ -168,6 +168,16 @@ class PullIntoInitializers extends RecursiveTransformer |
return node; |
} |
+ Statement visitNullCheck(NullCheck node) { |
+ if (node.condition != null) { |
+ node.condition = visitExpression(node.condition); |
+ // The value occurs in conditional context, so don't pull from that. |
+ } else { |
+ node.value = visitExpression(node.value); |
+ } |
+ return node; |
+ } |
+ |
Expression visitAssign(Assign node) { |
bool inImpureContext = impureCounter > 0; |
bool inBranch = branchCounter > 0; |