OLD | NEW |
| (Empty) |
1 export const closure = Object.create(null); | |
2 import { core, js, dart, dartx } from 'dart_sdk'; | |
3 closure.generic_function = function(T) { | |
4 return (items: core.List<T>, seed: T): core.List<T> => { | |
5 let strings = items[dartx.map](core.String)(dart.fn((i: T): string => `${i}`
, core.String, [T]))[dartx.toList](); | |
6 return items; | |
7 }; | |
8 }; | |
9 dart.fn(closure.generic_function, T => [core.List$(T), [core.List$(T), T]]); | |
10 closure.Callback = dart.typedef('Callback', () => dart.functionType(dart.void, [
], {i: core.int})); | |
11 closure.Foo$ = dart.generic(T => { | |
12 class Foo<T> extends core.Object { | |
13 i: number; | |
14 b: boolean; | |
15 s: string; | |
16 v: T; | |
17 static some_static_constant: string; | |
18 static some_static_final: string; | |
19 static some_static_var: string; | |
20 new(i: number, v: T) { | |
21 this.i = i; | |
22 this.v = v; | |
23 this.b = null; | |
24 this.s = null; | |
25 } | |
26 static build() { | |
27 return new (closure.Foo$(T))(1, null); | |
28 } | |
29 untyped_method(a, b) {} | |
30 pass(t: T) { | |
31 dart.as(t, T); | |
32 return t; | |
33 } | |
34 typed_method(foo: closure.Foo<any>, list: core.List<any>, i: number, n: numb
er, d: number, b: boolean, s: string, a: any[], o: Object, f: Function) { | |
35 return ''; | |
36 } | |
37 optional_params(a, b = null, c: number = null) {} | |
38 static named_params(a, {b = null, c = null}: {b?: any, c?: number} = {}) {} | |
39 nullary_method() {} | |
40 function_params(f: (x: any, y?: any) => number, g: (x: any, opts?: {y?: stri
ng, z?: any}) => any, cb: closure.Callback) { | |
41 cb({i: this.i}); | |
42 } | |
43 run(a: core.List<any>, b: string, c: (d: string) => core.List<any>, e: (f: (
g: any) => any) => core.List<number>, {h = null}: {h?: core.Map<core.Map<any, an
y>, core.Map<any, any>>} = {}) {} | |
44 get prop() { | |
45 return null; | |
46 } | |
47 set prop(value: string) {} | |
48 static get staticProp() { | |
49 return null; | |
50 } | |
51 static set staticProp(value: string) {} | |
52 } | |
53 dart.setSignature(Foo, { | |
54 constructors: () => ({ | |
55 new: [closure.Foo$(T), [core.int, T]], | |
56 build: [closure.Foo$(T), []] | |
57 }), | |
58 methods: () => ({ | |
59 untyped_method: [dart.dynamic, [dart.dynamic, dart.dynamic]], | |
60 pass: [T, [T]], | |
61 typed_method: [core.String, [closure.Foo, core.List, core.int, core.num, c
ore.double, core.bool, core.String, js.JsArray, js.JsObject, js.JsFunction]], | |
62 optional_params: [dart.dynamic, [dart.dynamic], [dart.dynamic, core.int]], | |
63 nullary_method: [dart.dynamic, []], | |
64 function_params: [dart.dynamic, [dart.functionType(core.int, [dart.dynamic
], [dart.dynamic]), dart.functionType(dart.dynamic, [dart.dynamic], {y: core.Str
ing, z: dart.dynamic}), closure.Callback]], | |
65 run: [dart.dynamic, [core.List, core.String, dart.functionType(core.List,
[core.String]), dart.functionType(core.List$(core.int), [dart.functionType(dart.
dynamic, [dart.dynamic])])], {h: core.Map$(core.Map, core.Map)}] | |
66 }), | |
67 statics: () => ({named_params: [dart.dynamic, [dart.dynamic], {b: dart.dynam
ic, c: core.int}]}), | |
68 names: ['named_params'] | |
69 }); | |
70 return Foo; | |
71 }); | |
72 closure.Foo = closure.Foo$(); | |
73 /** @final {string} */ | |
74 closure.Foo.some_static_constant = "abc"; | |
75 /** @final {string} */ | |
76 closure.Foo.some_static_final = "abc"; | |
77 /** @type {string} */ | |
78 closure.Foo.some_static_var = "abc"; | |
79 closure.Bar = class Bar extends core.Object {}; | |
80 closure.Baz = class Baz extends dart.mixin(closure.Foo$(core.int), closure.Bar)
{ | |
81 new(i: number) { | |
82 super.new(i, 123); | |
83 } | |
84 }; | |
85 dart.setSignature(closure.Baz, { | |
86 constructors: () => ({new: [closure.Baz, [core.int]]}) | |
87 }); | |
88 closure.main = function(args): void { | |
89 }; | |
90 dart.fn(closure.main, dart.void, [dart.dynamic]); | |
91 /** @final {string} */ | |
92 closure.some_top_level_constant = "abc"; | |
93 /** @final {string} */ | |
94 closure.some_top_level_final = "abc"; | |
95 /** @type {string} */ | |
96 closure.some_top_level_var = "abc"; | |
OLD | NEW |