OLD | NEW |
(Empty) | |
| 1 dart_library.library('corelib/iterable_last_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__iterable_last_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const _interceptors = dart_sdk._interceptors; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const expect$ = expect.expect; |
| 11 const iterable_last_test = Object.create(null); |
| 12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
| 13 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr
ray$(core.String)))(); |
| 14 let SetOfint = () => (SetOfint = dart.constFn(core.Set$(core.int)))(); |
| 15 let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionTyp
e(core.String, [])))(); |
| 16 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 17 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 18 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 19 let const$; |
| 20 iterable_last_test.main = function() { |
| 21 let list1 = JSArrayOfint().of([1, 2, 3]); |
| 22 let list2 = const$ || (const$ = dart.constList([4, 5], core.int)); |
| 23 let list3 = JSArrayOfString().of([]); |
| 24 let set1 = SetOfint().new(); |
| 25 set1.add(11); |
| 26 set1.add(12); |
| 27 set1.add(13); |
| 28 let set2 = core.Set.new(); |
| 29 expect$.Expect.equals(3, list1[dartx.last]); |
| 30 expect$.Expect.equals(5, list2[dartx.last]); |
| 31 expect$.Expect.throws(dart.fn(() => list3[dartx.last], VoidToString()), dart
.fn(e => core.StateError.is(e), dynamicTobool())); |
| 32 expect$.Expect.isTrue(set1.contains(set1.last)); |
| 33 expect$.Expect.throws(dart.fn(() => set2.last, VoidTovoid()), dart.fn(e => c
ore.StateError.is(e), dynamicTobool())); |
| 34 }; |
| 35 dart.fn(iterable_last_test.main, VoidTodynamic()); |
| 36 // Exports: |
| 37 exports.iterable_last_test = iterable_last_test; |
| 38 }); |
OLD | NEW |