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