OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/infinite_switch_label_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__infinite_switch_label_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 infinite_switch_label_test = Object.create(null); |
| 12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
| 13 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 14 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 15 let intTovoid = () => (intTovoid = dart.constFn(dart.definiteFunctionType(dart
.void, [core.int])))(); |
| 16 infinite_switch_label_test.main = function() { |
| 17 expect$.Expect.throws(dart.fn(() => infinite_switch_label_test.doSwitch(0),
VoidTovoid()), dart.fn(list => { |
| 18 expect$.Expect.listEquals(JSArrayOfint().of([0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0]), core.List._check(list)); |
| 19 return true; |
| 20 }, dynamicTobool())); |
| 21 expect$.Expect.throws(dart.fn(() => infinite_switch_label_test.doSwitch(2),
VoidTovoid()), dart.fn(list => { |
| 22 expect$.Expect.listEquals(JSArrayOfint().of([2, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0]), core.List._check(list)); |
| 23 return true; |
| 24 }, dynamicTobool())); |
| 25 }; |
| 26 dart.fn(infinite_switch_label_test.main, VoidTovoid()); |
| 27 infinite_switch_label_test.doSwitch = function(target) { |
| 28 let list = []; |
| 29 switch (target) { |
| 30 case 0: |
| 31 { |
| 32 // Unimplemented case labels: [l0:] |
| 33 if (dart.notNull(list[dartx.length]) > 10) dart.throw(list); |
| 34 list[dartx.add](0); |
| 35 continue l1; |
| 36 } |
| 37 case 1: |
| 38 { |
| 39 // Unimplemented case labels: [l1:] |
| 40 if (dart.notNull(list[dartx.length]) > 10) dart.throw(list); |
| 41 list[dartx.add](1); |
| 42 continue l0; |
| 43 } |
| 44 default: |
| 45 { |
| 46 list[dartx.add](2); |
| 47 continue l1; |
| 48 } |
| 49 } |
| 50 }; |
| 51 dart.fn(infinite_switch_label_test.doSwitch, intTovoid()); |
| 52 // Exports: |
| 53 exports.infinite_switch_label_test = infinite_switch_label_test; |
| 54 }); |
OLD | NEW |