OLD | NEW |
1 dart_library.library('language/context_test', null, /* Imports */[ | 1 dart_library.library('language/context_test', null, /* Imports */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'expect' | 3 'expect' |
4 ], function load__context_test(exports, dart_sdk, expect) { | 4 ], function load__context_test(exports, dart_sdk, expect) { |
5 'use strict'; | 5 'use strict'; |
6 const core = dart_sdk.core; | 6 const core = dart_sdk.core; |
7 const dart = dart_sdk.dart; | 7 const dart = dart_sdk.dart; |
8 const dartx = dart_sdk.dartx; | 8 const dartx = dart_sdk.dartx; |
9 const expect$ = expect.expect; | 9 const expect$ = expect.expect; |
10 const context_test = Object.create(null); | 10 const context_test = Object.create(null); |
| 11 let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core
.int, [])))(); |
11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); | 12 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
12 context_test.ContextTest = class ContextTest extends core.Object { | 13 context_test.ContextTest = class ContextTest extends core.Object { |
13 static foo(f) { | 14 static foo(f) { |
14 return dart.dcall(f); | 15 return dart.dcall(f); |
15 } | 16 } |
16 static testMain() { | 17 static testMain() { |
17 let x = 42; | 18 let x = 42; |
18 function bar() { | 19 function bar() { |
19 return x; | 20 return x; |
20 } | 21 } |
21 dart.fn(bar, VoidTodynamic()); | 22 dart.fn(bar, VoidToint()); |
22 x++; | 23 x++; |
23 expect$.Expect.equals(43, context_test.ContextTest.foo(bar)); | 24 expect$.Expect.equals(43, context_test.ContextTest.foo(bar)); |
24 } | 25 } |
25 }; | 26 }; |
26 dart.setSignature(context_test.ContextTest, { | 27 dart.setSignature(context_test.ContextTest, { |
27 statics: () => ({ | 28 statics: () => ({ |
28 foo: dart.definiteFunctionType(dart.dynamic, [core.Function]), | 29 foo: dart.definiteFunctionType(dart.dynamic, [core.Function]), |
29 testMain: dart.definiteFunctionType(dart.void, []) | 30 testMain: dart.definiteFunctionType(dart.void, []) |
30 }), | 31 }), |
31 names: ['foo', 'testMain'] | 32 names: ['foo', 'testMain'] |
32 }); | 33 }); |
33 context_test.main = function() { | 34 context_test.main = function() { |
34 context_test.ContextTest.testMain(); | 35 context_test.ContextTest.testMain(); |
35 }; | 36 }; |
36 dart.fn(context_test.main, VoidTodynamic()); | 37 dart.fn(context_test.main, VoidTodynamic()); |
37 // Exports: | 38 // Exports: |
38 exports.context_test = context_test; | 39 exports.context_test = context_test; |
39 }); | 40 }); |
OLD | NEW |