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

Unified Diff: frog/leg/ssa/closure.dart

Issue 9327001: Implement super initializers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and update test expectations. Created 8 years, 10 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: frog/leg/ssa/closure.dart
diff --git a/frog/leg/ssa/closure.dart b/frog/leg/ssa/closure.dart
index 456803d80e4f1f6169ec9b9aad24464a9e36139a..1d7e3e62679f14c3896974b0f54d0e45ae8f2a65 100644
--- a/frog/leg/ssa/closure.dart
+++ b/frog/leg/ssa/closure.dart
@@ -143,7 +143,13 @@ class ClosureTranslator extends AbstractVisitor {
}
void useLocal(Element element) {
- if (element.enclosingElement != currentFunctionElement) {
+ // TODO(floitsch): replace this with a general solution.
+ Element functionElement = currentFunctionElement;
+ if (functionElement.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
+ ConstructorBodyElement body = functionElement;
+ functionElement = body.constructor;
+ }
+ if (element.enclosingElement != functionElement) {
assert(closureData.freeVariableMapping[element] == null ||
closureData.freeVariableMapping[element] == element);
closureData.freeVariableMapping[element] = element;

Powered by Google App Engine
This is Rietveld 408576698