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

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

Issue 2991853002: Fix duplicate context creation when closures appear in initializers. (Closed)
Patch Set: Review comments. 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 {
6 field dynamic t; 6 field dynamic t;
7 constructor foo(dynamic f) → void 7 constructor foo(dynamic f, dynamic x) → 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(3), this self::C::foo#redir(f, x, #cont ext)
9 final Vector #context = MakeVector(2); 9 ;
10 #context[1] = f; 10 constructor foo#redir(dynamic f, dynamic x, final Vector #context) → void
11 core::print(1); 11 : dynamic #t1 = #context[1] = f, dynamic #t2 = #context[2] = x, self::C::t = MakeClosure<() → dynamic>(self::closure#C#foo#function, #context), super core:: Object::•() {
12 #context[2] = 1;
13 core::print(#context[2]);
12 } 14 }
13 } 15 }
14 static method main() → dynamic { 16 static method main() → dynamic {
15 core::print(0); 17 core::print(0);
16 dynamic c = new self::C::foo(MakeClosure<() → dynamic>(self::closure#main#func tion, null)); 18 dynamic c = new self::C::foo(MakeClosure<(dynamic) → dynamic>(self::closure#ma in#function, null), 0);
17 core::print(2); 19 core::print(2);
18 c.t(); 20 c.t();
19 core::print(3); 21 core::print(3);
20 } 22 }
21 static method closure#C#foo#function(Vector #contextParameter) → dynamic { 23 static method closure#C#foo#function(Vector #contextParameter) → dynamic {
22 return (#contextParameter[1]).call(); 24 return (#contextParameter[1]).call(#contextParameter[2]);
23 } 25 }
24 static method closure#main#function(Vector #contextParameter) → dynamic { 26 static method closure#main#function(Vector #contextParameter, dynamic x) → dynam ic {
25 return core::print("hest"); 27 return core::print("hest${x}");
26 } 28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698