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

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

Issue 2561723003: Merge kernel closure conversion into the Dart SDK (Closed)
Patch Set: Remove path constraint Created 4 years 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/static_tear_off.dart.expect
diff --git a/pkg/kernel/testcases/closures/static_tear_off.dart.expect b/pkg/kernel/testcases/closures/static_tear_off.dart.expect
new file mode 100644
index 0000000000000000000000000000000000000000..70958901bad152cf86a3fc565252a135cd3b2d86
--- /dev/null
+++ b/pkg/kernel/testcases/closures/static_tear_off.dart.expect
@@ -0,0 +1,84 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Closure#f_1_1_no_default extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ constructor •() → dynamic
+ ;
+ method call(dynamic a, [dynamic b]) → dynamic
+ return self::f_1_1_no_default(a, b);
+}
+class Closure#f_1_1_default extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ constructor •() → dynamic
+ ;
+ method call(dynamic a, [dynamic b = 2]) → dynamic
+ return self::f_1_1_default(a, b);
+}
+class Closure#f_1_b_no_default extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ constructor •() → dynamic
+ ;
+ method call(dynamic a, {dynamic b}) → dynamic
+ return self::f_1_b_no_default(a, b: b);
+}
+class Closure#f_1_b_default extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ constructor •() → dynamic
+ ;
+ method call(dynamic a, {dynamic b = 2}) → dynamic
+ return self::f_1_b_default(a, b: b);
+}
+static method f_1_1_no_default(dynamic a, [dynamic b]) → dynamic {
+ return a.+(b);
+}
+static method f_1_1_default(dynamic a, [dynamic b = 2]) → dynamic {
+ return a.+(b);
+}
+static method f_1_b_no_default(dynamic a, {dynamic b}) → dynamic {
+ return a.+(b);
+}
+static method f_1_b_default(dynamic a, {dynamic b = 2}) → dynamic {
+ return a.+(b);
+}
+static method test_1_1(core::Function f, core::bool hasDefault) → dynamic {
+ dynamic result = f.call(40, 2);
+ if(!42.==(result))
+ throw "Unexpected result: ${result}";
+ self::test_1(f, hasDefault);
+}
+static method test_1_b(core::Function f, core::bool hasDefault) → dynamic {
+ dynamic result = f.call(40, b: 2);
+ if(!42.==(result))
+ throw "Unexpected result: ${result}";
+ self::test_1(f, hasDefault);
+}
+static method test_1(core::Function f, core::bool hasDefault) → dynamic {
+ dynamic result = 0;
+ core::bool threw = true;
+ try {
+ result = f.call(40);
+ threw = false;
+ }
+ on dynamic catch(dynamic _) {
+ }
+ if(hasDefault) {
+ if(threw)
+ throw "Unexpected exception.";
+ if(!42.==(result))
+ throw "Unexpected result: ${result}.";
+ }
+ else {
+ if(!threw)
+ throw "Expected exception missing.";
+ if(!0.==(result))
+ throw "Unexpected result: ${result}.";
+ }
+}
+static method main(dynamic arguments) → dynamic {
+ self::test_1_1(new self::Closure#f_1_1_no_default::•(), false);
+ self::test_1_1(new self::Closure#f_1_1_default::•(), true);
+ self::test_1_b(new self::Closure#f_1_b_no_default::•(), false);
+ self::test_1_b(new self::Closure#f_1_b_default::•(), true);
+}
« no previous file with comments | « pkg/kernel/testcases/closures/static_tear_off.dart ('k') | pkg/kernel/testcases/closures/type_variables.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698