OLD | NEW |
1 dart_library.library('functions', null, /* Imports */[ | 1 dart_library.library('functions', null, /* Imports */[ |
2 'dart/_runtime', | 2 'dart_sdk' |
3 'dart/core' | 3 ], function(exports, dart_sdk) { |
4 ], /* Lazy imports */[ | |
5 ], function(exports, dart, core) { | |
6 'use strict'; | 4 'use strict'; |
7 let dartx = dart.dartx; | 5 const core = dart_sdk.core; |
8 function bootstrap() { | 6 const dart = dart_sdk.dart; |
9 return dart.list([new Foo()], Foo); | 7 const dartx = dart_sdk.dartx; |
10 } | 8 const functions = Object.create(null); |
11 dart.fn(bootstrap, () => dart.definiteFunctionType(core.List$(Foo), [])); | 9 functions.bootstrap = function() { |
12 const A2B$ = dart.generic(function(A, B) { | 10 return dart.list([new functions.Foo()], functions.Foo); |
| 11 }; |
| 12 dart.fn(functions.bootstrap, () => dart.definiteFunctionType(core.List$(functi
ons.Foo), [])); |
| 13 functions.A2B$ = dart.generic((A, B) => { |
13 const A2B = dart.typedef('A2B', () => dart.functionType(B, [A])); | 14 const A2B = dart.typedef('A2B', () => dart.functionType(B, [A])); |
14 return A2B; | 15 return A2B; |
15 }); | 16 }); |
16 let A2B = A2B$(); | 17 functions.A2B = functions.A2B$(); |
17 function id(f) { | 18 functions.id = function(f) { |
18 return f; | 19 return f; |
19 } | 20 }; |
20 dart.fn(id, () => dart.definiteFunctionType(A2B$(Foo, Foo), [A2B$(Foo, Foo)]))
; | 21 dart.fn(functions.id, () => dart.definiteFunctionType(functions.A2B$(functions
.Foo, functions.Foo), [functions.A2B$(functions.Foo, functions.Foo)])); |
21 class Foo extends core.Object {} | 22 functions.Foo = class Foo extends core.Object {}; |
22 function main() { | 23 functions.main = function() { |
23 core.print(bootstrap()[dartx.get](0)); | 24 core.print(functions.bootstrap()[dartx.get](0)); |
24 } | 25 }; |
25 dart.fn(main, dart.void, []); | 26 dart.fn(functions.main, dart.void, []); |
26 // Exports: | 27 // Exports: |
27 exports.bootstrap = bootstrap; | 28 exports.functions = functions; |
28 exports.A2B$ = A2B$; | |
29 exports.A2B = A2B; | |
30 exports.id = id; | |
31 exports.Foo = Foo; | |
32 exports.main = main; | |
33 }); | 29 }); |
OLD | NEW |