Index: test/codegen/expect/language/context_test.js |
diff --git a/test/codegen/expect/language/context_test.js b/test/codegen/expect/language/context_test.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e52d14c8d220d4c1d0f3df185530600b0c4996bc |
--- /dev/null |
+++ b/test/codegen/expect/language/context_test.js |
@@ -0,0 +1,39 @@ |
+dart_library.library('language/context_test', null, /* Imports */[ |
+ 'dart_sdk', |
+ 'expect' |
+], function load__context_test(exports, dart_sdk, expect) { |
+ 'use strict'; |
+ const core = dart_sdk.core; |
+ const dart = dart_sdk.dart; |
+ const dartx = dart_sdk.dartx; |
+ const expect$ = expect.expect; |
+ const context_test = Object.create(null); |
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))(); |
+ context_test.ContextTest = class ContextTest extends core.Object { |
+ static foo(f) { |
+ return dart.dcall(f); |
+ } |
+ static testMain() { |
+ let x = 42; |
+ function bar() { |
+ return x; |
+ } |
+ dart.fn(bar, VoidTodynamic()); |
+ x++; |
+ expect$.Expect.equals(43, context_test.ContextTest.foo(bar)); |
+ } |
+ }; |
+ dart.setSignature(context_test.ContextTest, { |
+ statics: () => ({ |
+ foo: dart.definiteFunctionType(dart.dynamic, [core.Function]), |
+ testMain: dart.definiteFunctionType(dart.void, []) |
+ }), |
+ names: ['foo', 'testMain'] |
+ }); |
+ context_test.main = function() { |
+ context_test.ContextTest.testMain(); |
+ }; |
+ dart.fn(context_test.main, VoidTodynamic()); |
+ // Exports: |
+ exports.context_test = context_test; |
+}); |