OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/optimized_lists_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__optimized_lists_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const expect$ = expect.expect; |
| 10 const optimized_lists_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 13 optimized_lists_test.main = function() { |
| 14 for (let i = 0; i < 20; i++) { |
| 15 optimized_lists_test.test(2); |
| 16 } |
| 17 }; |
| 18 dart.fn(optimized_lists_test.main, VoidTodynamic()); |
| 19 let const$; |
| 20 optimized_lists_test.test = function(n) { |
| 21 let a = core.List.new(); |
| 22 let b = core.List.new(10); |
| 23 let c = const$ || (const$ = dart.constList([1, 2, 3, 4], core.int)); |
| 24 a[dartx.add](4); |
| 25 b[dartx.set](0, 5); |
| 26 expect$.Expect.equals(4, a[dartx.get](0)); |
| 27 expect$.Expect.equals(5, b[dartx.get](0)); |
| 28 expect$.Expect.equals(2, c[dartx.get](1)); |
| 29 let v = c[dartx.get](core.int._check(n)); |
| 30 expect$.Expect.equals(v, c[dartx.get](core.int._check(n))); |
| 31 }; |
| 32 dart.fn(optimized_lists_test.test, dynamicTodynamic()); |
| 33 // Exports: |
| 34 exports.optimized_lists_test = optimized_lists_test; |
| 35 }); |
OLD | NEW |