OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/try_catch_optimized4_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__try_catch_optimized4_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 try_catch_optimized4_test = Object.create(null); |
| 12 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr
ray$(core.Object)))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 dart.defineLazy(try_catch_optimized4_test, { |
| 15 get a() { |
| 16 return JSArrayOfObject().of([1, 2, 3, 4, 5]); |
| 17 }, |
| 18 set a(_) {} |
| 19 }); |
| 20 try_catch_optimized4_test.MyError = class MyError extends core.Object {}; |
| 21 try_catch_optimized4_test.M = class M extends core.Object { |
| 22 maythrow(i) { |
| 23 try { |
| 24 if (dart.test(dart.dsend(i, '<=', 5))) dart.throw(new try_catch_optimize
d4_test.MyError()); |
| 25 } catch (e) { |
| 26 dart.throw(e); |
| 27 } |
| 28 |
| 29 } |
| 30 }; |
| 31 dart.setSignature(try_catch_optimized4_test.M, { |
| 32 methods: () => ({maythrow: dart.definiteFunctionType(dart.dynamic, [dart.dyn
amic])}) |
| 33 }); |
| 34 try_catch_optimized4_test.loop_test = function() { |
| 35 let failed = false; |
| 36 let m = new try_catch_optimized4_test.M(); |
| 37 for (let i of try_catch_optimized4_test.a) { |
| 38 try { |
| 39 let res = core.String._check(m.maythrow(i)); |
| 40 failed = true; |
| 41 } catch (e) { |
| 42 if (try_catch_optimized4_test.MyError.is(e)) { |
| 43 } else |
| 44 throw e; |
| 45 } |
| 46 |
| 47 if (!core.identical(failed, false)) { |
| 48 expect$.Expect.fail(""); |
| 49 } |
| 50 } |
| 51 }; |
| 52 dart.fn(try_catch_optimized4_test.loop_test, VoidTodynamic()); |
| 53 try_catch_optimized4_test.main = function() { |
| 54 for (let i = 0; i < 20; i++) |
| 55 try_catch_optimized4_test.loop_test(); |
| 56 }; |
| 57 dart.fn(try_catch_optimized4_test.main, VoidTodynamic()); |
| 58 // Exports: |
| 59 exports.try_catch_optimized4_test = try_catch_optimized4_test; |
| 60 }); |
OLD | NEW |