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

Unified Diff: tests/compiler/dart2js/closure/data/captured_variable.dart

Issue 3009903002: Pass in `this` as a free variable to the closure class (Closed)
Patch Set: merge with master Created 3 years, 4 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: tests/compiler/dart2js/closure/data/captured_variable.dart
diff --git a/tests/compiler/dart2js/closure/data/captured_variable.dart b/tests/compiler/dart2js/closure/data/captured_variable.dart
index 871af5fbdb54025822559263686aa6b1fba9b6fe..e7474d4bc993cfb9e7868f769fbf3304988881ae 100644
--- a/tests/compiler/dart2js/closure/data/captured_variable.dart
+++ b/tests/compiler/dart2js/closure/data/captured_variable.dart
@@ -62,6 +62,15 @@ writeLocalInClosure(/**/ parameter) {
return func;
}
+class Foo {
+ int /*Foo.bar:hasThis*/ bar = 4;
+
+ /*Foo.baz:hasThis*/ baz() {
+ /*free=[this],hasThis*/ func() => bar;
+ return func;
+ }
+}
+
main() {
readParameterInAnonymousClosure(null);
readParameterInClosure(null);
@@ -71,4 +80,5 @@ main() {
readLocalInClosure(null);
writeLocalInAnonymousClosure(null);
writeLocalInClosure(null);
+ new Foo().baz();
}

Powered by Google App Engine
This is Rietveld 408576698