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

Unified Diff: pkg/kernel/testcases/closures/capture_closure_parameter.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/capture_closure_parameter.dart.expect
diff --git a/pkg/kernel/testcases/closures/capture_closure_parameter.dart.expect b/pkg/kernel/testcases/closures/capture_closure_parameter.dart.expect
index 5683153c26b05097515e12c581da9aafe1bf5a3b..d977771ff9d37be46260d95fab4cc6a263d0ecd1 100644
--- a/pkg/kernel/testcases/closures/capture_closure_parameter.dart.expect
+++ b/pkg/kernel/testcases/closures/capture_closure_parameter.dart.expect
@@ -2,35 +2,17 @@ library;
import self as self;
import "dart:core" as core;
-class Closure#main#foo#bar 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#foo#bar::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#foo#bar::context};
- core::print(#contextParameter[1]);
- }
-}
-class Closure#main#foo 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#foo::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#foo::context};
- final Vector #context = MakeVector(2);
- #context[0] = #contextParameter;
- #context[1] = null;
- final () → dynamic bar = new self::Closure#main#foo#bar::•(#context);
- return bar;
- }
-}
static method main(core::List<core::String> arguments) → dynamic {
- final (dynamic) → dynamic foo = new self::Closure#main#foo::•(null);
+ final (dynamic) → dynamic foo = MakeClosure<(dynamic) → dynamic>(self::closure#main#foo, null);
foo.call(arguments.[](0)).call();
}
+static method closure#main#foo#bar(Vector #contextParameter) → dynamic {
+ core::print(#contextParameter[1]);
+}
+static method closure#main#foo(Vector #contextParameter, dynamic x) → dynamic {
+ final Vector #context = MakeVector(2);
+ #context[0] = #contextParameter;
+ #context[1] = x;
+ final () → dynamic bar = MakeClosure<() → dynamic>(self::closure#main#foo#bar, #context);
+ return bar;
+}
« no previous file with comments | « pkg/kernel/testcases/closures/capture_closure.dart.expect ('k') | pkg/kernel/testcases/closures/capture_this.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698