Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: test/codegen_expected/corelib/json_map_test.js

Issue 2211293002: Reify type params on map literals (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Remove unnecessary null check Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 dart_library.library('corelib/json_map_test', null, /* Imports */[ 1 dart_library.library('corelib/json_map_test', null, /* Imports */[
2 'dart_sdk', 2 'dart_sdk',
3 'expect' 3 'expect'
4 ], function load__json_map_test(exports, dart_sdk, expect) { 4 ], function load__json_map_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 convert = dart_sdk.convert; 7 const convert = dart_sdk.convert;
8 const _interceptors = dart_sdk._interceptors; 8 const _interceptors = dart_sdk._interceptors;
9 const collection = dart_sdk.collection; 9 const collection = dart_sdk.collection;
10 const dart = dart_sdk.dart; 10 const dart = dart_sdk.dart;
11 const dartx = dart_sdk.dartx; 11 const dartx = dart_sdk.dartx;
12 const expect$ = expect.expect; 12 const expect$ = expect.expect;
13 const json_map_test = Object.create(null); 13 const json_map_test = Object.create(null);
14 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr ray$(core.String)))(); 14 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr ray$(core.String)))();
15 let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$( core.String, dart.dynamic)))(); 15 let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$( core.String, dart.dynamic)))();
16 let HashMapOfString$dynamic = () => (HashMapOfString$dynamic = dart.constFn(co llection.HashMap$(core.String, dart.dynamic)))(); 16 let HashMapOfString$dynamic = () => (HashMapOfString$dynamic = dart.constFn(co llection.HashMap$(core.String, dart.dynamic)))();
17 let LinkedHashMapOfString$dynamic = () => (LinkedHashMapOfString$dynamic = dar t.constFn(collection.LinkedHashMap$(core.String, dart.dynamic)))(); 17 let LinkedHashMapOfString$dynamic = () => (LinkedHashMapOfString$dynamic = dar t.constFn(collection.LinkedHashMap$(core.String, dart.dynamic)))();
18 let MapOfint$dynamic = () => (MapOfint$dynamic = dart.constFn(core.Map$(core.i nt, dart.dynamic)))(); 18 let MapOfint$dynamic = () => (MapOfint$dynamic = dart.constFn(core.Map$(core.i nt, dart.dynamic)))();
19 let HashMapOfint$dynamic = () => (HashMapOfint$dynamic = dart.constFn(collecti on.HashMap$(core.int, dart.dynamic)))(); 19 let HashMapOfint$dynamic = () => (HashMapOfint$dynamic = dart.constFn(collecti on.HashMap$(core.int, dart.dynamic)))();
20 let LinkedHashMapOfint$dynamic = () => (LinkedHashMapOfint$dynamic = dart.cons tFn(collection.LinkedHashMap$(core.int, dart.dynamic)))(); 20 let LinkedHashMapOfint$dynamic = () => (LinkedHashMapOfint$dynamic = dart.cons tFn(collection.LinkedHashMap$(core.int, dart.dynamic)))();
21 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr ray$(core.Object)))(); 21 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr ray$(core.Object)))();
22 let ListOfObject = () => (ListOfObject = dart.constFn(core.List$(core.Object)) )();
22 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons tFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))(); 23 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons tFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))();
23 let MapToMap = () => (MapToMap = dart.constFn(dart.definiteFunctionType(core.M ap, [core.Map])))(); 24 let MapToMap = () => (MapToMap = dart.constFn(dart.definiteFunctionType(core.M ap, [core.Map])))();
24 let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart .definiteFunctionType(dart.void, [core.String, dart.dynamic])))(); 25 let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart .definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
25 let MapToList = () => (MapToList = dart.constFn(dart.definiteFunctionType(core .List, [core.Map])))(); 26 let MapToList = () => (MapToList = dart.constFn(dart.definiteFunctionType(core .List, [core.Map])))();
26 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [])))(); 27 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [])))();
27 let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionTyp e(core.String, [])))(); 28 let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionTyp e(core.String, [])))();
28 let boolTovoid = () => (boolTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [core.bool])))(); 29 let boolTovoid = () => (boolTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [core.bool])))();
29 let MapTovoid = () => (MapTovoid = dart.constFn(dart.definiteFunctionType(dart .void, [core.Map])))(); 30 let MapTovoid = () => (MapTovoid = dart.constFn(dart.definiteFunctionType(dart .void, [core.Map])))();
30 let ListTovoid = () => (ListTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [core.List])))(); 31 let ListTovoid = () => (ListTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [core.List])))();
31 let MapAndIterableAndFunctionTovoid = () => (MapAndIterableAndFunctionTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Map, core.Iterable, cor e.Function])))(); 32 let MapAndIterableAndFunctionTovoid = () => (MapAndIterableAndFunctionTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Map, core.Iterable, cor e.Function])))();
(...skipping 19 matching lines...) Expand all
51 }; 52 };
52 dart.fn(json_map_test.listEach, MapToList()); 53 dart.fn(json_map_test.listEach, MapToList());
53 json_map_test.main = function() { 54 json_map_test.main = function() {
54 json_map_test.test(false); 55 json_map_test.test(false);
55 json_map_test.test(true); 56 json_map_test.test(true);
56 }; 57 };
57 dart.fn(json_map_test.main, VoidTovoid()); 58 dart.fn(json_map_test.main, VoidTovoid());
58 json_map_test.test = function(revive) { 59 json_map_test.test = function(revive) {
59 json_map_test.useReviver = revive; 60 json_map_test.useReviver = revive;
60 json_map_test.testEmpty(json_map_test.jsonify(dart.map())); 61 json_map_test.testEmpty(json_map_test.jsonify(dart.map()));
61 json_map_test.testAtoB(json_map_test.jsonify(dart.map({a: 'b'}))); 62 json_map_test.testAtoB(json_map_test.jsonify(dart.map({a: 'b'}, core.String, core.String)));
62 let map = json_map_test.jsonify(dart.map()); 63 let map = json_map_test.jsonify(dart.map());
63 map[dartx.set]('a', 'b'); 64 map[dartx.set]('a', 'b');
64 json_map_test.testAtoB(map); 65 json_map_test.testAtoB(map);
65 map = json_map_test.jsonify(dart.map()); 66 map = json_map_test.jsonify(dart.map());
66 expect$.Expect.equals('b', map[dartx.putIfAbsent]('a', dart.fn(() => 'b', Vo idToString()))); 67 expect$.Expect.equals('b', map[dartx.putIfAbsent]('a', dart.fn(() => 'b', Vo idToString())));
67 json_map_test.testAtoB(map); 68 json_map_test.testAtoB(map);
68 map = json_map_test.jsonify(dart.map()); 69 map = json_map_test.jsonify(dart.map());
69 map[dartx.addAll](dart.map({a: 'b'})); 70 map[dartx.addAll](dart.map({a: 'b'}, core.String, core.String));
70 json_map_test.testAtoB(map); 71 json_map_test.testAtoB(map);
71 json_map_test.testOrder(JSArrayOfString().of(['a', 'b', 'c', 'd', 'e', 'f']) ); 72 json_map_test.testOrder(JSArrayOfString().of(['a', 'b', 'c', 'd', 'e', 'f']) );
72 json_map_test.testProto(); 73 json_map_test.testProto();
73 json_map_test.testToString(); 74 json_map_test.testToString();
74 json_map_test.testConcurrentModifications(); 75 json_map_test.testConcurrentModifications();
75 json_map_test.testType(); 76 json_map_test.testType();
76 json_map_test.testNonStringKeys(); 77 json_map_test.testNonStringKeys();
77 json_map_test.testClear(); 78 json_map_test.testClear();
78 json_map_test.testListEntry(); 79 json_map_test.testListEntry();
79 json_map_test.testMutation(); 80 json_map_test.testMutation();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 expect$.Expect.equals(list[dartx.length], map[dartx.length]); 146 expect$.Expect.equals(list[dartx.length], map[dartx.length]);
146 expect$.Expect.listEquals(list, map[dartx.keys][dartx.toList]()); 147 expect$.Expect.listEquals(list, map[dartx.keys][dartx.toList]());
147 for (let i = 0; i < 10; i++) { 148 for (let i = 0; i < 10; i++) {
148 map[dartx.set](dart.str`${i}`, i); 149 map[dartx.set](dart.str`${i}`, i);
149 expect$.Expect.equals(dart.notNull(list[dartx.length]) + i + 1, map[dartx. length]); 150 expect$.Expect.equals(dart.notNull(list[dartx.length]) + i + 1, map[dartx. length]);
150 expect$.Expect.listEquals(list, map[dartx.keys][dartx.take](list[dartx.len gth])[dartx.toList]()); 151 expect$.Expect.listEquals(list, map[dartx.keys][dartx.take](list[dartx.len gth])[dartx.toList]());
151 } 152 }
152 }; 153 };
153 dart.fn(json_map_test.testOrder, ListTovoid()); 154 dart.fn(json_map_test.testOrder, ListTovoid());
154 json_map_test.testProto = function() { 155 json_map_test.testProto = function() {
155 let map = json_map_test.jsonify(dart.map({__proto__: 0})); 156 let map = json_map_test.jsonify(dart.map({__proto__: 0}, core.String, core.i nt));
156 expect$.Expect.equals(1, map[dartx.length]); 157 expect$.Expect.equals(1, map[dartx.length]);
157 expect$.Expect.isTrue(map[dartx.containsKey]('__proto__')); 158 expect$.Expect.isTrue(map[dartx.containsKey]('__proto__'));
158 expect$.Expect.listEquals(JSArrayOfString().of(['__proto__']), map[dartx.key s][dartx.toList]()); 159 expect$.Expect.listEquals(JSArrayOfString().of(['__proto__']), map[dartx.key s][dartx.toList]());
159 expect$.Expect.equals(0, map[dartx.get]('__proto__')); 160 expect$.Expect.equals(0, map[dartx.get]('__proto__'));
160 expect$.Expect.equals(0, map[dartx.remove]('__proto__')); 161 expect$.Expect.equals(0, map[dartx.remove]('__proto__'));
161 json_map_test.testEmpty(map); 162 json_map_test.testEmpty(map);
162 map = json_map_test.jsonify(dart.map({__proto__: null})); 163 map = json_map_test.jsonify(dart.map({__proto__: null}, core.String, dart.dy namic));
163 expect$.Expect.equals(1, map[dartx.length]); 164 expect$.Expect.equals(1, map[dartx.length]);
164 expect$.Expect.isTrue(map[dartx.containsKey]('__proto__')); 165 expect$.Expect.isTrue(map[dartx.containsKey]('__proto__'));
165 expect$.Expect.listEquals(JSArrayOfString().of(['__proto__']), map[dartx.key s][dartx.toList]()); 166 expect$.Expect.listEquals(JSArrayOfString().of(['__proto__']), map[dartx.key s][dartx.toList]());
166 expect$.Expect.isNull(map[dartx.get]('__proto__')); 167 expect$.Expect.isNull(map[dartx.get]('__proto__'));
167 expect$.Expect.isNull(map[dartx.remove]('__proto__')); 168 expect$.Expect.isNull(map[dartx.remove]('__proto__'));
168 json_map_test.testEmpty(map); 169 json_map_test.testEmpty(map);
169 }; 170 };
170 dart.fn(json_map_test.testProto, VoidTovoid()); 171 dart.fn(json_map_test.testProto, VoidTovoid());
171 json_map_test.testToString = function() { 172 json_map_test.testToString = function() {
172 expect$.Expect.equals("{}", dart.toString(json_map_test.jsonify(dart.map())) ); 173 expect$.Expect.equals("{}", dart.toString(json_map_test.jsonify(dart.map())) );
173 expect$.Expect.equals("{a: 0}", dart.toString(json_map_test.jsonify(dart.map ({a: 0})))); 174 expect$.Expect.equals("{a: 0}", dart.toString(json_map_test.jsonify(dart.map ({a: 0}, core.String, core.int))));
174 }; 175 };
175 dart.fn(json_map_test.testToString, VoidTovoid()); 176 dart.fn(json_map_test.testToString, VoidTovoid());
176 json_map_test.testConcurrentModifications = function() { 177 json_map_test.testConcurrentModifications = function() {
177 function testIterate(map, iterable, f) { 178 function testIterate(map, iterable, f) {
178 let iterator = iterable[dartx.iterator]; 179 let iterator = iterable[dartx.iterator];
179 dart.dcall(f, map); 180 dart.dcall(f, map);
180 iterator.moveNext(); 181 iterator.moveNext();
181 } 182 }
182 dart.fn(testIterate, MapAndIterableAndFunctionTovoid()); 183 dart.fn(testIterate, MapAndIterableAndFunctionTovoid());
183 function testKeys(map, f) { 184 function testKeys(map, f) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTo void()))); 220 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTo void())));
220 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), Voi dTovoid()))); 221 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), Voi dTovoid())));
221 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), V oidTovoid()))); 222 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), V oidTovoid())));
222 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), VoidTovoid()))); 223 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), VoidTovoid())));
223 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, VoidT oint())), dynamicTodynamic())), VoidTovoid()))); 224 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, VoidT oint())), dynamicTodynamic())), VoidTovoid())));
224 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, Voi dToint())), dynamicTodynamic())), VoidTovoid()))); 225 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, Voi dToint())), dynamicTodynamic())), VoidTovoid())));
225 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, V oidToint())), dynamicTodynamic())), VoidTovoid()))); 226 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, V oidToint())), dynamicTodynamic())), VoidTovoid())));
226 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic() )), VoidTovoid()))); 227 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic() )), VoidTovoid())));
227 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic ())), VoidTovoid()))); 228 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic ())), VoidTovoid())));
228 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynami c())), VoidTovoid()))); 229 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynami c())), VoidTovoid())));
229 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0})), dynamicTodyna mic())), VoidTovoid()))); 230 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0}, core.String, co re.int)), dynamicTodynamic())), VoidTovoid())));
230 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0})), dynamicTody namic())), VoidTovoid()))); 231 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0}, core.String, core.int)), dynamicTodynamic())), VoidTovoid())));
231 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0})), dynamicTo dynamic())), VoidTovoid()))); 232 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0}, core.String , core.int)), dynamicTodynamic())), VoidTovoid())));
232 map = dart.map({a: 1}); 233 map = dart.map({a: 1}, core.String, core.int);
233 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsetindex(map, 'a', 0), dynamicToint())), VoidTovoid ()))); 234 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsetindex(map, 'a', 0), dynamicToint())), VoidTovoid ())));
234 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsetindex(map, 'a', 0), dynamicToint())), VoidTovo id()))); 235 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsetindex(map, 'a', 0), dynamicToint())), VoidTovo id())));
235 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsetindex(map, 'a', 0), dynamicToint())), VoidTov oid()))); 236 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsetindex(map, 'a', 0), dynamicToint())), VoidTov oid())));
236 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsetindex(map, 'b', 0), dynamicToint())), VoidTovoid( )))); 237 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsetindex(map, 'b', 0), dynamicToint())), VoidTovoid( ))));
237 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsetindex(map, 'b', 0), dynamicToint())), VoidTovoi d()))); 238 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsetindex(map, 'b', 0), dynamicToint())), VoidTovoi d())));
238 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsetindex(map, 'b', 0), dynamicToint())), VoidTovo id()))); 239 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsetindex(map, 'b', 0), dynamicToint())), VoidTovo id())));
239 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTovoid ()))); 240 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTovoid ())));
240 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTovo id()))); 241 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTovo id())));
241 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTov oid()))); 242 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'clear'), dynamicTodynamic())), VoidTov oid())));
242 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), Void Tovoid()))); 243 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), Void Tovoid())));
243 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), Vo idTovoid()))); 244 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), Vo idTovoid())));
244 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), V oidTovoid()))); 245 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'remove', 'a'), dynamicTodynamic())), V oidTovoid())));
245 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'remove', 'b'), dynamicTodynamic())), Voi dTovoid()))); 246 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'remove', 'b'), dynamicTodynamic())), Voi dTovoid())));
246 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'remove', 'b'), dynamicTodynamic())), V oidTovoid()))); 247 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'remove', 'b'), dynamicTodynamic())), V oidTovoid())));
247 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'remove', 'b'), dynamicTodynamic())), VoidTovoid()))); 248 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'remove', 'b'), dynamicTodynamic())), VoidTovoid())));
248 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, Void Toint())), dynamicTodynamic())), VoidTovoid()))); 249 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, Void Toint())), dynamicTodynamic())), VoidTovoid())));
249 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, Vo idToint())), dynamicTodynamic())), VoidTovoid()))); 250 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, Vo idToint())), dynamicTodynamic())), VoidTovoid())));
250 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, V oidToint())), dynamicTodynamic())), VoidTovoid()))); 251 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'a', dart.fn(() => 0, V oidToint())), dynamicTodynamic())), VoidTovoid())));
251 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'b', dart.fn(() => 0, VoidT oint())), dynamicTodynamic())), VoidTovoid()))); 252 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'b', dart.fn(() => 0, VoidT oint())), dynamicTodynamic())), VoidTovoid())));
252 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'b', dart.fn(() => 0, Voi dToint())), dynamicTodynamic())), VoidTovoid()))); 253 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'b', dart.fn(() => 0, Voi dToint())), dynamicTodynamic())), VoidTovoid())));
253 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'b', dart.fn(() => 0, Vo idToint())), dynamicTodynamic())), VoidTovoid()))); 254 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'putIfAbsent', 'b', dart.fn(() => 0, Vo idToint())), dynamicTodynamic())), VoidTovoid())));
254 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic() )), VoidTovoid()))); 255 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic() )), VoidTovoid())));
255 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic ())), VoidTovoid()))); 256 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynamic ())), VoidTovoid())));
256 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynami c())), VoidTovoid()))); 257 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map()), dynamicTodynami c())), VoidTovoid())));
257 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0})), dynamicTodyn amic())), VoidTovoid()))); 258 expect$.Expect.isFalse(throwsCME(dart.fn(() => testKeys(json_map_test.jsonif y(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0}, core.String, c ore.int)), dynamicTodynamic())), VoidTovoid())));
258 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0})), dynamicTod ynamic())), VoidTovoid()))); 259 expect$.Expect.isFalse(throwsCME(dart.fn(() => testValues(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0}, core.String, core.int)), dynamicTodynamic())), VoidTovoid())));
259 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0})), dynamicTo dynamic())), VoidTovoid()))); 260 expect$.Expect.isFalse(throwsCME(dart.fn(() => testForEach(json_map_test.jso nify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({a: 0}, core.String , core.int)), dynamicTodynamic())), VoidTovoid())));
260 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({b: 0})), dynamicTodyna mic())), VoidTovoid()))); 261 expect$.Expect.isTrue(throwsCME(dart.fn(() => testKeys(json_map_test.jsonify (map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({b: 0}, core.String, co re.int)), dynamicTodynamic())), VoidTovoid())));
261 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({b: 0})), dynamicTody namic())), VoidTovoid()))); 262 expect$.Expect.isTrue(throwsCME(dart.fn(() => testValues(json_map_test.jsoni fy(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({b: 0}, core.String, core.int)), dynamicTodynamic())), VoidTovoid())));
262 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({b: 0})), dynamicTod ynamic())), VoidTovoid()))); 263 expect$.Expect.isTrue(throwsCME(dart.fn(() => testForEach(json_map_test.json ify(map), dart.fn(map => dart.dsend(map, 'addAll', dart.map({b: 0}, core.String, core.int)), dynamicTodynamic())), VoidTovoid())));
263 }; 264 };
264 dart.fn(json_map_test.testConcurrentModifications, VoidTovoid()); 265 dart.fn(json_map_test.testConcurrentModifications, VoidTovoid());
265 json_map_test.testType = function() { 266 json_map_test.testType = function() {
266 expect$.Expect.isTrue(core.Map.is(json_map_test.jsonify(dart.map()))); 267 expect$.Expect.isTrue(core.Map.is(json_map_test.jsonify(dart.map())));
267 expect$.Expect.isTrue(collection.HashMap.is(json_map_test.jsonify(dart.map() ))); 268 expect$.Expect.isTrue(collection.HashMap.is(json_map_test.jsonify(dart.map() )));
268 expect$.Expect.isTrue(collection.LinkedHashMap.is(json_map_test.jsonify(dart .map()))); 269 expect$.Expect.isTrue(collection.LinkedHashMap.is(json_map_test.jsonify(dart .map())));
269 expect$.Expect.isTrue(MapOfString$dynamic().is(json_map_test.jsonify(dart.ma p()))); 270 expect$.Expect.isTrue(MapOfString$dynamic().is(json_map_test.jsonify(dart.ma p())));
270 expect$.Expect.isTrue(HashMapOfString$dynamic().is(json_map_test.jsonify(dar t.map()))); 271 expect$.Expect.isTrue(HashMapOfString$dynamic().is(json_map_test.jsonify(dar t.map())));
271 expect$.Expect.isTrue(LinkedHashMapOfString$dynamic().is(json_map_test.jsoni fy(dart.map()))); 272 expect$.Expect.isTrue(LinkedHashMapOfString$dynamic().is(json_map_test.jsoni fy(dart.map())));
272 expect$.Expect.isTrue(MapOfint$dynamic().is(json_map_test.jsonify(dart.map() ))); 273 expect$.Expect.isTrue(MapOfint$dynamic().is(json_map_test.jsonify(dart.map() )));
273 expect$.Expect.isTrue(HashMapOfint$dynamic().is(json_map_test.jsonify(dart.m ap()))); 274 expect$.Expect.isTrue(HashMapOfint$dynamic().is(json_map_test.jsonify(dart.m ap())));
274 expect$.Expect.isTrue(LinkedHashMapOfint$dynamic().is(json_map_test.jsonify( dart.map()))); 275 expect$.Expect.isTrue(LinkedHashMapOfint$dynamic().is(json_map_test.jsonify( dart.map())));
275 }; 276 };
276 dart.fn(json_map_test.testType, VoidTovoid()); 277 dart.fn(json_map_test.testType, VoidTovoid());
277 json_map_test.testNonStringKeys = function() { 278 json_map_test.testNonStringKeys = function() {
278 let map = json_map_test.jsonify(dart.map()); 279 let map = json_map_test.jsonify(dart.map());
279 map[dartx.set](1, 2); 280 map[dartx.set](1, 2);
280 expect$.Expect.equals(1, map[dartx.length]); 281 expect$.Expect.equals(1, map[dartx.length]);
281 expect$.Expect.equals(2, map[dartx.get](1)); 282 expect$.Expect.equals(2, map[dartx.get](1));
282 }; 283 };
283 dart.fn(json_map_test.testNonStringKeys, VoidTovoid()); 284 dart.fn(json_map_test.testNonStringKeys, VoidTovoid());
284 json_map_test.testClear = function() { 285 json_map_test.testClear = function() {
285 let map = json_map_test.jsonify(dart.map({a: 0})); 286 let map = json_map_test.jsonify(dart.map({a: 0}, core.String, core.int));
286 map[dartx.clear](); 287 map[dartx.clear]();
287 expect$.Expect.equals(0, map[dartx.length]); 288 expect$.Expect.equals(0, map[dartx.length]);
288 }; 289 };
289 dart.fn(json_map_test.testClear, VoidTovoid()); 290 dart.fn(json_map_test.testClear, VoidTovoid());
290 json_map_test.testListEntry = function() { 291 json_map_test.testListEntry = function() {
291 let map = json_map_test.jsonify(dart.map({a: JSArrayOfObject().of([7, 8, dar t.map({b: 9})])})); 292 let map = json_map_test.jsonify(dart.map({a: JSArrayOfObject().of([7, 8, dar t.map({b: 9}, core.String, core.int)])}, core.String, ListOfObject()));
292 let list = core.List._check(map[dartx.get]('a')); 293 let list = core.List._check(map[dartx.get]('a'));
293 expect$.Expect.equals(3, list[dartx.length]); 294 expect$.Expect.equals(3, list[dartx.length]);
294 expect$.Expect.equals(7, list[dartx.get](0)); 295 expect$.Expect.equals(7, list[dartx.get](0));
295 expect$.Expect.equals(8, list[dartx.get](1)); 296 expect$.Expect.equals(8, list[dartx.get](1));
296 expect$.Expect.equals(9, dart.dindex(list[dartx.get](2), 'b')); 297 expect$.Expect.equals(9, dart.dindex(list[dartx.get](2), 'b'));
297 }; 298 };
298 dart.fn(json_map_test.testListEntry, VoidTovoid()); 299 dart.fn(json_map_test.testListEntry, VoidTovoid());
299 json_map_test.testMutation = function() { 300 json_map_test.testMutation = function() {
300 let map = json_map_test.jsonify(dart.map({a: 0})); 301 let map = json_map_test.jsonify(dart.map({a: 0}, core.String, core.int));
301 expect$.Expect.listEquals(JSArrayOfObject().of(['a', 0]), json_map_test.list Each(map)); 302 expect$.Expect.listEquals(JSArrayOfObject().of(['a', 0]), json_map_test.list Each(map));
302 map[dartx.set]('a', 1); 303 map[dartx.set]('a', 1);
303 expect$.Expect.listEquals(JSArrayOfObject().of(['a', 1]), json_map_test.list Each(map)); 304 expect$.Expect.listEquals(JSArrayOfObject().of(['a', 1]), json_map_test.list Each(map));
304 let i = 'a'; 305 let i = 'a';
305 map[dartx.set](i, dart.dsend(map[dartx.get](i), '+', 1)); 306 map[dartx.set](i, dart.dsend(map[dartx.get](i), '+', 1));
306 expect$.Expect.listEquals(JSArrayOfObject().of(['a', 2]), json_map_test.list Each(map)); 307 expect$.Expect.listEquals(JSArrayOfObject().of(['a', 2]), json_map_test.list Each(map));
307 }; 308 };
308 dart.fn(json_map_test.testMutation, VoidTovoid()); 309 dart.fn(json_map_test.testMutation, VoidTovoid());
309 // Exports: 310 // Exports:
310 exports.json_map_test = json_map_test; 311 exports.json_map_test = json_map_test;
311 }); 312 });
OLDNEW
« no previous file with comments | « test/codegen_expected/corelib/expando_test.js ('k') | test/codegen_expected/corelib/map_from_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698