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

Unified Diff: pkg/compiler/lib/src/kernel/closure.dart

Issue 2951723002: Add closure_test for kernel based members (Closed)
Patch Set: Cleanup Created 3 years, 6 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: pkg/compiler/lib/src/kernel/closure.dart
diff --git a/pkg/compiler/lib/src/kernel/closure.dart b/pkg/compiler/lib/src/kernel/closure.dart
index f441d7fbc02cae60edeeb2deb4d3a6833ba96c02..9354ae3c29280f351abcde25a64792e1cb9b5ab2 100644
--- a/pkg/compiler/lib/src/kernel/closure.dart
+++ b/pkg/compiler/lib/src/kernel/closure.dart
@@ -47,6 +47,14 @@ class KernelClosureDataBuilder extends ir.Visitor {
info.registerUsedInTryOrSync(_localsMap.getLocal(node.variable));
}
}
+
+ @override
+ visitVariableSet(ir.VariableSet node) {
+ if (_inTry) {
+ info.registerUsedInTryOrSync(_localsMap.getLocal(node.variable));
+ }
+ node.visitChildren(this);
+ }
}
/// Closure conversion code using our new Entity model. Closure conversion is
@@ -131,4 +139,11 @@ class KernelClosureRepresentationInfo extends ClosureRepresentationInfo {
bool variableIsUsedInTryOrSync(Local variable) =>
_localsUsedInTryOrSync.contains(variable);
+
+ String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.write('this=$thisLocal,');
+ sb.write('localsUsedInTryOrSync={${_localsUsedInTryOrSync.join(', ')}}');
+ return sb.toString();
+ }
}
« no previous file with comments | « pkg/compiler/lib/src/js_model/js_strategy.dart ('k') | pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698