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

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

Issue 2211293002: Reify type params on map literals (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Suppress empty arg with dynamic params 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/map_values_test', null, /* Imports */[ 1 dart_library.library('corelib/map_values_test', null, /* Imports */[
2 'dart_sdk', 2 'dart_sdk',
3 'expect' 3 'expect'
4 ], function load__map_values_test(exports, dart_sdk, expect) { 4 ], function load__map_values_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 map_values_test = Object.create(null); 10 const map_values_test = Object.create(null);
11 let MapOfString$int = () => (MapOfString$int = dart.constFn(core.Map$(core.Str ing, core.int)))(); 11 let MapOfString$int = () => (MapOfString$int = dart.constFn(core.Map$(core.Str ing, core.int)))();
12 let MapOfString$bool = () => (MapOfString$bool = dart.constFn(core.Map$(core.S tring, core.bool)))(); 12 let MapOfString$bool = () => (MapOfString$bool = dart.constFn(core.Map$(core.S tring, core.bool)))();
13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))(); 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
14 let const$; 14 let const$;
15 let const$0; 15 let const$0;
16 map_values_test.main = function() { 16 map_values_test.main = function() {
17 let map1 = dart.map({foo: 42, bar: 499}); 17 let map1 = dart.map({foo: 42, bar: 499}, core.String, core.int);
18 let map2 = dart.map(); 18 let map2 = dart.map();
19 let map3 = const$ || (const$ = dart.const(dart.map({foo: 42, bar: 499}))); 19 let map3 = const$ || (const$ = dart.const(dart.map({foo: 42, bar: 499}, core .String, core.int)));
20 let map4 = const$0 || (const$0 = dart.const(dart.map())); 20 let map4 = const$0 || (const$0 = dart.const(dart.map()));
21 let map5 = MapOfString$int().new(); 21 let map5 = MapOfString$int().new();
22 map5[dartx.set]("foo", 43); 22 map5[dartx.set]("foo", 43);
23 map5[dartx.set]("bar", 500); 23 map5[dartx.set]("bar", 500);
24 let map6 = MapOfString$bool().new(); 24 let map6 = MapOfString$bool().new();
25 expect$.Expect.isTrue(core.Iterable.is(map1[dartx.values])); 25 expect$.Expect.isTrue(core.Iterable.is(map1[dartx.values]));
26 expect$.Expect.isFalse(core.List.is(map1[dartx.values])); 26 expect$.Expect.isFalse(core.List.is(map1[dartx.values]));
27 expect$.Expect.equals(2, map1[dartx.values][dartx.length]); 27 expect$.Expect.equals(2, map1[dartx.values][dartx.length]);
28 expect$.Expect.equals(42, map1[dartx.values][dartx.first]); 28 expect$.Expect.equals(42, map1[dartx.values][dartx.first]);
29 expect$.Expect.equals(499, map1[dartx.values][dartx.last]); 29 expect$.Expect.equals(499, map1[dartx.values][dartx.last]);
(...skipping 15 matching lines...) Expand all
45 expect$.Expect.isTrue(map5[dartx.values][dartx.last] == 43 || map5[dartx.val ues][dartx.last] == 500); 45 expect$.Expect.isTrue(map5[dartx.values][dartx.last] == 43 || map5[dartx.val ues][dartx.last] == 500);
46 expect$.Expect.notEquals(map5[dartx.values][dartx.first], map5[dartx.values] [dartx.last]); 46 expect$.Expect.notEquals(map5[dartx.values][dartx.first], map5[dartx.values] [dartx.last]);
47 expect$.Expect.isTrue(core.Iterable.is(map6[dartx.values])); 47 expect$.Expect.isTrue(core.Iterable.is(map6[dartx.values]));
48 expect$.Expect.isFalse(core.List.is(map6[dartx.values])); 48 expect$.Expect.isFalse(core.List.is(map6[dartx.values]));
49 expect$.Expect.equals(0, map6[dartx.values][dartx.length]); 49 expect$.Expect.equals(0, map6[dartx.values][dartx.length]);
50 }; 50 };
51 dart.fn(map_values_test.main, VoidTodynamic()); 51 dart.fn(map_values_test.main, VoidTodynamic());
52 // Exports: 52 // Exports:
53 exports.map_values_test = map_values_test; 53 exports.map_values_test = map_values_test;
54 }); 54 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698