OLD | NEW |
1 dart_library.library('language/const_map_test', null, /* Imports */[ | 1 dart_library.library('language/const_map_test', null, /* Imports */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'expect' | 3 'expect' |
4 ], function load__const_map_test(exports, dart_sdk, expect) { | 4 ], function load__const_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 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 const_map_test = Object.create(null); | 10 const const_map_test = Object.create(null); |
11 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); | 11 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
12 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); | 12 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
13 const_map_test.confuse = function(x) { | 13 const_map_test.confuse = function(x) { |
14 if (dart.equals(new core.DateTime.now(), 42)) return const_map_test.confuse(
2); | 14 if (dart.equals(new core.DateTime.now(), 42)) return const_map_test.confuse(
2); |
15 return x; | 15 return x; |
16 }; | 16 }; |
17 dart.fn(const_map_test.confuse, dynamicTodynamic()); | 17 dart.fn(const_map_test.confuse, dynamicTodynamic()); |
18 let const$; | 18 let const$; |
19 const_map_test.main = function() { | 19 const_map_test.main = function() { |
20 let m = const$ || (const$ = dart.const(dart.map([1, 42, "foo", 499]))); | 20 let m = const$ || (const$ = dart.const(dart.map([1, 42, "foo", 499], core.Ob
ject, core.int))); |
21 expect$.Expect.equals(42, m[dartx.get](const_map_test.confuse(1.0))); | 21 expect$.Expect.equals(42, m[dartx.get](const_map_test.confuse(1.0))); |
22 expect$.Expect.equals(499, m[dartx.get](const_map_test.confuse(core.String.f
romCharCodes("foo"[dartx.runes])))); | 22 expect$.Expect.equals(499, m[dartx.get](const_map_test.confuse(core.String.f
romCharCodes("foo"[dartx.runes])))); |
23 }; | 23 }; |
24 dart.fn(const_map_test.main, VoidTodynamic()); | 24 dart.fn(const_map_test.main, VoidTodynamic()); |
25 // Exports: | 25 // Exports: |
26 exports.const_map_test = const_map_test; | 26 exports.const_map_test = const_map_test; |
27 }); | 27 }); |
OLD | NEW |