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

Side by Side Diff: pkg/kernel/testcases/closures/closure_in_initializer_closure.dart.expect

Issue 2991853002: Fix duplicate context creation when closures appear in initializers. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 library; 1 library;
2 import self as self; 2 import self as self;
3 import "dart:core" as core; 3 import "dart:core" as core;
4 4
5 class C extends core::Object { 5 class C extends core::Object {
Dmitry Stefantsov 2017/07/28 12:36:16 I believe, this is the corresponding Dart code: `
sjindel 2017/07/31 12:06:21 Done.
6 field dynamic t; 6 field dynamic t;
7 constructor foo(dynamic f) → void 7 constructor foo(dynamic f) → void
8 : final Vector #context = MakeVector(2), dynamic #t1 = #context[1] = f, self ::C::t = MakeClosure<() → dynamic>(self::closure#C#foo#function, #context), supe r core::Object::•() { 8 : final Vector #context = MakeVector(2), this self::C::foo#redir(f, #context )
9 final Vector #context = MakeVector(2); 9 ;
10 #context[1] = f; 10 constructor foo#redir(dynamic f, final Vector #context) → void
11 : dynamic #t1 = #context[1] = f, self::C::t = MakeClosure<() → dynamic>(self ::closure#C#foo#function, #context), super core::Object::•() {
11 core::print(1); 12 core::print(1);
12 } 13 }
13 } 14 }
14 static method main() → dynamic { 15 static method main() → dynamic {
15 core::print(0); 16 core::print(0);
16 dynamic c = new self::C::foo(MakeClosure<(dynamic) → dynamic>(self::closure#ma in#function, null)); 17 dynamic c = new self::C::foo(MakeClosure<(dynamic) → dynamic>(self::closure#ma in#function, null));
17 core::print(2); 18 core::print(2);
18 c.t().call("fisk"); 19 c.t().call("fisk");
19 core::print(3); 20 core::print(3);
20 } 21 }
21 static method closure#C#foo#function#function(Vector #contextParameter, dynamic x) → dynamic { 22 static method closure#C#foo#function#function(Vector #contextParameter, dynamic x) → dynamic {
22 (#contextParameter[0][1]).call("${#contextParameter[1]}${x}"); 23 (#contextParameter[0][1]).call("${#contextParameter[1]}${x}");
23 } 24 }
24 static method closure#C#foo#function(Vector #contextParameter) → dynamic { 25 static method closure#C#foo#function(Vector #contextParameter) → dynamic {
25 final Vector #context = MakeVector(2); 26 final Vector #context = MakeVector(2);
26 #context[0] = #contextParameter; 27 #context[0] = #contextParameter;
27 #context[1] = null; 28 #context[1] = null;
28 dynamic g = MakeClosure<(dynamic) → dynamic>(self::closure#C#foo#function#func tion, #context); 29 dynamic g = MakeClosure<(dynamic) → dynamic>(self::closure#C#foo#function#func tion, #context);
29 #context[1] = "hest"; 30 #context[1] = "hest";
30 return g; 31 return g;
31 } 32 }
32 static method closure#main#function(Vector #contextParameter, dynamic x) → dynam ic { 33 static method closure#main#function(Vector #contextParameter, dynamic x) → dynam ic {
33 return core::print(x); 34 return core::print(x);
34 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698