Index: pkg/kernel/lib/transformations/closure/rewriter.dart |
diff --git a/pkg/kernel/lib/transformations/closure/rewriter.dart b/pkg/kernel/lib/transformations/closure/rewriter.dart |
index 6b962fd7b042b92da805e5857c22348db33e307e..6a73dfa5198e2928489a4435a55f49277179db4d 100644 |
--- a/pkg/kernel/lib/transformations/closure/rewriter.dart |
+++ b/pkg/kernel/lib/transformations/closure/rewriter.dart |
@@ -72,10 +72,12 @@ class BlockRewriter extends AstRewriter { |
void insertContextDeclaration(Class contextClass, Expression accessParent) { |
_createDeclaration(contextClass); |
_insertStatement(contextDeclaration); |
- _insertStatement(new ExpressionStatement(new PropertySet( |
- new VariableGet(contextDeclaration), |
- new Name('parent'), |
- accessParent))); |
+ if (accessParent is! NullLiteral) { |
+ _insertStatement(new ExpressionStatement(new PropertySet( |
+ new VariableGet(contextDeclaration), |
+ new Name('parent'), |
+ accessParent))); |
+ } |
} |
void insertExtendContext(Expression accessContext, Arguments arguments) { |