| OLD | NEW |
| 1 dart_library.library('try_catch', null, /* Imports */[ | 1 dart_library.library('try_catch', null, /* Imports */[ |
| 2 "dart_runtime/dart", | 2 "dart_runtime/dart", |
| 3 'dart/core' | 3 'dart/core' |
| 4 ], /* Lazy imports */[ | 4 ], /* Lazy imports */[ |
| 5 ], function(exports, dart, core) { | 5 ], function(exports, dart, core) { |
| 6 'use strict'; | 6 'use strict'; |
| 7 let dartx = dart.dartx; | 7 let dartx = dart.dartx; |
| 8 function foo() { | 8 function foo() { |
| 9 try { | 9 try { |
| 10 throw "hi there"; | 10 dart.throw("hi there"); |
| 11 } catch (e$) { | 11 } catch (e$) { |
| 12 if (dart.is(e$, core.String)) { | 12 if (dart.is(e$, core.String)) { |
| 13 let e = e$; | 13 let e = e$; |
| 14 let t = dart.stackTrace(e); | 14 let t = dart.stackTrace(e); |
| 15 } else { | 15 } else { |
| 16 let e = e$; | 16 let e = e$; |
| 17 let t = dart.stackTrace(e); | 17 let t = dart.stackTrace(e); |
| 18 throw e; | 18 throw e; |
| 19 } | 19 } |
| 20 } | 20 } |
| 21 | 21 |
| 22 } | 22 } |
| 23 dart.fn(foo); | 23 dart.fn(foo); |
| 24 function bar() { | 24 function bar() { |
| 25 try { | 25 try { |
| 26 throw "hi there"; | 26 dart.throw("hi there"); |
| 27 } catch (e$) { | 27 } catch (e$) { |
| 28 let e = e$; | 28 let e = e$; |
| 29 let t = dart.stackTrace(e); | 29 let t = dart.stackTrace(e); |
| 30 } | 30 } |
| 31 | 31 |
| 32 } | 32 } |
| 33 dart.fn(bar); | 33 dart.fn(bar); |
| 34 function baz() { | 34 function baz() { |
| 35 try { | 35 try { |
| 36 throw "finally only"; | 36 dart.throw("finally only"); |
| 37 } finally { | 37 } finally { |
| 38 return true; | 38 return true; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 dart.fn(baz); | 41 dart.fn(baz); |
| 42 function qux() { | 42 function qux() { |
| 43 try { | 43 try { |
| 44 throw "on only"; | 44 dart.throw("on only"); |
| 45 } catch (e) { | 45 } catch (e) { |
| 46 if (dart.is(e, core.String)) { | 46 if (dart.is(e, core.String)) { |
| 47 let t = dart.stackTrace(e); | 47 let t = dart.stackTrace(e); |
| 48 throw e; | 48 throw e; |
| 49 } else | 49 } else |
| 50 throw e; | 50 throw e; |
| 51 } | 51 } |
| 52 | 52 |
| 53 } | 53 } |
| 54 dart.fn(qux); | 54 dart.fn(qux); |
| 55 function wub() { | 55 function wub() { |
| 56 try { | 56 try { |
| 57 throw "on without exception parameter"; | 57 dart.throw("on without exception parameter"); |
| 58 } catch (e) { | 58 } catch (e) { |
| 59 if (dart.is(e, core.String)) { | 59 if (dart.is(e, core.String)) { |
| 60 } else | 60 } else |
| 61 throw e; | 61 throw e; |
| 62 } | 62 } |
| 63 | 63 |
| 64 } | 64 } |
| 65 dart.fn(wub); | 65 dart.fn(wub); |
| 66 function main() { | 66 function main() { |
| 67 foo(); | 67 foo(); |
| 68 bar(); | 68 bar(); |
| 69 baz(); | 69 baz(); |
| 70 qux(); | 70 qux(); |
| 71 wub(); | 71 wub(); |
| 72 } | 72 } |
| 73 dart.fn(main); | 73 dart.fn(main); |
| 74 // Exports: | 74 // Exports: |
| 75 exports.foo = foo; | 75 exports.foo = foo; |
| 76 exports.bar = bar; | 76 exports.bar = bar; |
| 77 exports.baz = baz; | 77 exports.baz = baz; |
| 78 exports.qux = qux; | 78 exports.qux = qux; |
| 79 exports.wub = wub; | 79 exports.wub = wub; |
| 80 exports.main = main; | 80 exports.main = main; |
| 81 }); | 81 }); |
| OLD | NEW |