OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/try_catch_optimized3_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__try_catch_optimized3_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 try_catch_optimized3_test = Object.create(null); |
| 11 let boolTodynamic = () => (boolTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [core.bool])))(); |
| 12 let doubleAndboolTodynamic = () => (doubleAndboolTodynamic = dart.constFn(dart
.definiteFunctionType(dart.dynamic, [core.double, core.bool])))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 try_catch_optimized3_test.foo = function(b) { |
| 15 if (dart.test(b)) dart.throw(123); |
| 16 }; |
| 17 dart.fn(try_catch_optimized3_test.foo, boolTodynamic()); |
| 18 try_catch_optimized3_test.test_double = function(x, b) { |
| 19 try { |
| 20 x = dart.notNull(x) + 1.0; |
| 21 try_catch_optimized3_test.foo(b); |
| 22 } catch (e) { |
| 23 let result = dart.notNull(x) - 1.0; |
| 24 expect$.Expect.equals(1.0, result); |
| 25 return result; |
| 26 } |
| 27 |
| 28 }; |
| 29 dart.fn(try_catch_optimized3_test.test_double, doubleAndboolTodynamic()); |
| 30 try_catch_optimized3_test.main = function() { |
| 31 for (let i = 0; i < 100; i++) |
| 32 try_catch_optimized3_test.test_double(1.0, false); |
| 33 try_catch_optimized3_test.test_double(1.0, false); |
| 34 expect$.Expect.equals(1.0, try_catch_optimized3_test.test_double(1.0, true))
; |
| 35 }; |
| 36 dart.fn(try_catch_optimized3_test.main, VoidTodynamic()); |
| 37 // Exports: |
| 38 exports.try_catch_optimized3_test = try_catch_optimized3_test; |
| 39 }); |
OLD | NEW |