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

Unified Diff: pkg/kernel/testcases/closures_initializers/initializers.dart

Issue 2981603002: Convert closures in all initializers, and share the context between them. (Closed)
Patch Set: Fix unnecessary context bug. Created 3 years, 5 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/kernel/testcases/closures_initializers/initializers.dart
diff --git a/pkg/kernel/testcases/closures_initializers/initializers.dart b/pkg/kernel/testcases/closures_initializers/initializers.dart
index 82d9285e83d55774271d01ff47a3821ae94fd7e1..8ccc3c4ae55dc83e1a244d6b45cce8569726953e 100644
--- a/pkg/kernel/testcases/closures_initializers/initializers.dart
+++ b/pkg/kernel/testcases/closures_initializers/initializers.dart
@@ -19,6 +19,21 @@ class A {
A(X i) : foo = ((() => i)());
}
+// Closure in super initializer.
+//
+class S extends A {
+ S(X i) : super((() => i)());
+}
+
+// Closure in redirecting constructor.
+//
+class S2 {
+ X foo;
+ S2(this.foo);
+
+ S2.wat(X i) : this((() => i)());
Dmitry Stefantsov 2017/07/13 07:19:53 How this test case is different from the one for t
sjindel 2017/07/13 11:34:05 It wasn't -- I fixed this in patch set 2 by changi
+}
+
// Closure in local initializer.
//
class B {
@@ -32,4 +47,8 @@ main() {
a.foo; // To prevent dartanalyzer from marking [a] as unused.
B b = new B(new X());
b.foo;
+ S s = new S(new X());
+ s.foo;
+ S2 s2 = new S2(new X());
+ s2.foo;
}

Powered by Google App Engine
This is Rietveld 408576698