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

Unified Diff: pkg/kernel/testcases/closures/non_void_context.dart.expect

Issue 2778223002: Add primitive to create closures and use it for closure conversion (Closed)
Patch Set: Follow common pattern for AST nodes with References in ClosureCreation Created 3 years, 9 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/non_void_context.dart.expect
diff --git a/pkg/kernel/testcases/closures/non_void_context.dart.expect b/pkg/kernel/testcases/closures/non_void_context.dart.expect
index f7a40d6a77ee84bdd7fe6427556af07c33e712bb..347fd35eec3d3f0c815c9f771764ac0a1990a872 100644
--- a/pkg/kernel/testcases/closures/non_void_context.dart.expect
+++ b/pkg/kernel/testcases/closures/non_void_context.dart.expect
@@ -1,38 +1,11 @@
library;
import self as self;
-import "dart:core" as core;
-class Closure#main#function extends core::Object implements core::Function {
- field core::String note = "This is temporary. The VM doesn't need closure classes.";
- field Vector context;
- constructor •(final Vector context) → dynamic
- : self::Closure#main#function::context = context
- ;
- method call(dynamic x) → dynamic {
- "This is a temporary solution. In the VM, this will become an additional parameter.";
- final Vector #contextParameter = this.{self::Closure#main#function::context};
- return self::v = #contextParameter[1] = x;
- }
-}
-class Closure#main#function#1 extends core::Object implements core::Function {
- field core::String note = "This is temporary. The VM doesn't need closure classes.";
- field Vector context;
- constructor •(final Vector context) → dynamic
- : self::Closure#main#function#1::context = context
- ;
- method call() → dynamic {
- "This is a temporary solution. In the VM, this will become an additional parameter.";
- final Vector #contextParameter = this.{self::Closure#main#function#1::context};
- for (; #contextParameter[1] = self::v; ) {
- self::v = false;
- }
- }
-}
static field dynamic v = null;
static method main(dynamic arguments) → dynamic {
final Vector #context = MakeVector(2);
#context[1] = null;
- new self::Closure#main#function::•(#context).call(87);
+ (MakeClosure<(dynamic) → dynamic>(self::closure#main#function, #context)).call(87);
if(!self::v.==(87)) {
throw "Unexpected value in v: ${self::v}";
}
@@ -40,7 +13,7 @@ static method main(dynamic arguments) → dynamic {
throw "Unexpected value in w: ${#context[1]}";
}
self::v = true;
- new self::Closure#main#function#1::•(#context).call();
+ (MakeClosure<() → dynamic>(self::closure#main#function#1, #context)).call();
if(!self::v.==(false)) {
throw "Unexpected value in v: ${self::v}";
}
@@ -48,3 +21,11 @@ static method main(dynamic arguments) → dynamic {
throw "Unexpected value in w: ${#context[1]}";
}
}
+static method closure#main#function(Vector #contextParameter, dynamic x) → dynamic {
+ return self::v = #contextParameter[1] = x;
+}
+static method closure#main#function#1(Vector #contextParameter) → dynamic {
+ for (; #contextParameter[1] = self::v; ) {
+ self::v = false;
+ }
+}
« no previous file with comments | « pkg/kernel/testcases/closures/named_closure.dart.expect ('k') | pkg/kernel/testcases/closures/static_tear_off.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698