OLD | NEW |
1 dart_library.library('corelib/apply_test', null, /* Imports */[ | 1 dart_library.library('corelib/apply_test', null, /* Imports */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'expect' | 3 'expect' |
4 ], function load__apply_test(exports, dart_sdk, expect) { | 4 ], function load__apply_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 _interceptors = dart_sdk._interceptors; | 7 const _interceptors = dart_sdk._interceptors; |
8 const dart = dart_sdk.dart; | 8 const dart = dart_sdk.dart; |
9 const dartx = dart_sdk.dartx; | 9 const dartx = dart_sdk.dartx; |
10 const expect$ = expect.expect; | 10 const expect$ = expect.expect; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 expect$.Expect.equals(res, core.Function.apply(core.Function._check(func),
core.List._check(list), MapOfSymbol$dynamic().new())); | 96 expect$.Expect.equals(res, core.Function.apply(core.Function._check(func),
core.List._check(list), MapOfSymbol$dynamic().new())); |
97 } | 97 } |
98 dart.fn(testList, dynamicAnddynamicAnddynamicTodynamic()); | 98 dart.fn(testList, dynamicAnddynamicAnddynamicTodynamic()); |
99 function test(res, func, list, map) { | 99 function test(res, func, list, map) { |
100 map = symbol_map_helper.symbolMapToStringMap(MapOfString$dynamic()._check(
map)); | 100 map = symbol_map_helper.symbolMapToStringMap(MapOfString$dynamic()._check(
map)); |
101 expect$.Expect.equals(res, core.Function.apply(core.Function._check(func),
core.List._check(list), MapOfSymbol$dynamic()._check(map))); | 101 expect$.Expect.equals(res, core.Function.apply(core.Function._check(func),
core.List._check(list), MapOfSymbol$dynamic()._check(map))); |
102 } | 102 } |
103 dart.fn(test, dynamicAnddynamicAnddynamic__Todynamic()); | 103 dart.fn(test, dynamicAnddynamicAnddynamic__Todynamic()); |
104 testList(42, apply_test.test0, null); | 104 testList(42, apply_test.test0, null); |
105 testList(42, apply_test.test0, []); | 105 testList(42, apply_test.test0, []); |
106 testMap(42, apply_test.test0a, dart.map({a: 5})); | 106 testMap(42, apply_test.test0a, dart.map({a: 5}, core.String, core.int)); |
107 testList(42, apply_test.test1, JSArrayOfint().of([41])); | 107 testList(42, apply_test.test1, JSArrayOfint().of([41])); |
108 test(42, apply_test.test1a, JSArrayOfint().of([20]), dart.map({a: 22})); | 108 test(42, apply_test.test1a, JSArrayOfint().of([20]), dart.map({a: 22}, core.
String, core.int)); |
109 testList(42, apply_test.test2, JSArrayOfint().of([20, 22])); | 109 testList(42, apply_test.test2, JSArrayOfint().of([20, 22])); |
110 test(42, apply_test.test2a, JSArrayOfint().of([10, 15]), dart.map({a: 17})); | 110 test(42, apply_test.test2a, JSArrayOfint().of([10, 15]), dart.map({a: 17}, c
ore.String, core.int)); |
111 let cfoo = dart.bind(new apply_test.C(), 'foo'); | 111 let cfoo = dart.bind(new apply_test.C(), 'foo'); |
112 testList(42, cfoo, JSArrayOfint().of([32])); | 112 testList(42, cfoo, JSArrayOfint().of([32])); |
113 let app = apply_test.confuse(core.Function.apply); | 113 let app = apply_test.confuse(core.Function.apply); |
114 expect$.Expect.equals(42, dart.dcall(app, apply_test.test2, JSArrayOfint().o
f([22, 20]))); | 114 expect$.Expect.equals(42, dart.dcall(app, apply_test.test2, JSArrayOfint().o
f([22, 20]))); |
115 expect$.Expect.equals(42, core.Function.apply(core.Function.apply, JSArrayOf
Object().of([apply_test.test2, JSArrayOfint().of([17, 25])]))); | 115 expect$.Expect.equals(42, core.Function.apply(core.Function.apply, JSArrayOf
Object().of([apply_test.test2, JSArrayOfint().of([17, 25])]))); |
116 testList(42, new apply_test.Callable(), JSArrayOfint().of([13, 29])); | 116 testList(42, new apply_test.Callable(), JSArrayOfint().of([13, 29])); |
117 }; | 117 }; |
118 dart.fn(apply_test.main, VoidTodynamic()); | 118 dart.fn(apply_test.main, VoidTodynamic()); |
119 symbol_map_helper.symbolMapToStringMap = function(map) { | 119 symbol_map_helper.symbolMapToStringMap = function(map) { |
120 if (map == null) return null; | 120 if (map == null) return null; |
121 let result = MapOfSymbol$dynamic().new(); | 121 let result = MapOfSymbol$dynamic().new(); |
122 map[dartx.forEach](dart.fn((name, value) => { | 122 map[dartx.forEach](dart.fn((name, value) => { |
123 result[dartx.set](core.Symbol.new(name), value); | 123 result[dartx.set](core.Symbol.new(name), value); |
124 }, StringAnddynamicTovoid())); | 124 }, StringAnddynamicTovoid())); |
125 return result; | 125 return result; |
126 }; | 126 }; |
127 dart.fn(symbol_map_helper.symbolMapToStringMap, MapOfString$dynamicToMapOfSymb
ol$dynamic()); | 127 dart.fn(symbol_map_helper.symbolMapToStringMap, MapOfString$dynamicToMapOfSymb
ol$dynamic()); |
128 // Exports: | 128 // Exports: |
129 exports.apply_test = apply_test; | 129 exports.apply_test = apply_test; |
130 exports.symbol_map_helper = symbol_map_helper; | 130 exports.symbol_map_helper = symbol_map_helper; |
131 }); | 131 }); |
OLD | NEW |