Index: pkg/compiler/lib/src/cps_ir/cps_fragment.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart |
index 4a1f34056156fdb184f01b250f4e70d3856e78cf..cecad3191c8bbc8f295d11f3cc67b0f8b5d9a3c6 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart |
@@ -83,6 +83,7 @@ class CpsFragment { |
} |
if (context != null) { |
context.body = node; |
+ node.parent = context; |
} |
context = null; |
} |
@@ -297,4 +298,19 @@ class CpsFragment { |
put(let); |
context = let; |
} |
+ |
+ void insertBelow(InteriorNode node) { |
+ assert(isOpen); |
+ if (isEmpty) return; |
+ Expression child = node.body; |
+ node.body = root; |
+ root.parent = node; |
+ context.body = child; |
+ child.parent = context; |
+ root = context = null; |
+ } |
+ |
+ void insertAbove(InteriorExpression node) { |
+ insertBelow(node.parent); |
+ } |
} |