main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | export default function _usingCtx() {
|
---|
2 | var r = "function" == typeof SuppressedError ? SuppressedError : function (r, n) {
|
---|
3 | var e = new Error();
|
---|
4 | return e.name = "SuppressedError", e.suppressed = n, e.error = r, e;
|
---|
5 | },
|
---|
6 | n = {},
|
---|
7 | e = [];
|
---|
8 | function using(r, n) {
|
---|
9 | if (null != n) {
|
---|
10 | if (Object(n) !== n) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
---|
11 | if (r) var o = n[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
---|
12 | if (null == o && (o = n[Symbol.dispose || Symbol["for"]("Symbol.dispose")]), "function" != typeof o) throw new TypeError("Property [Symbol.dispose] is not a function.");
|
---|
13 | e.push({
|
---|
14 | v: n,
|
---|
15 | d: o,
|
---|
16 | a: r
|
---|
17 | });
|
---|
18 | }
|
---|
19 | return n;
|
---|
20 | }
|
---|
21 | return {
|
---|
22 | e: n,
|
---|
23 | u: using.bind(null, !1),
|
---|
24 | a: using.bind(null, !0),
|
---|
25 | d: function d() {
|
---|
26 | var o = this.e;
|
---|
27 | function next() {
|
---|
28 | for (; r = e.pop();) try {
|
---|
29 | var r,
|
---|
30 | t = r.d.call(r.v);
|
---|
31 | if (r.a) return Promise.resolve(t).then(next, err);
|
---|
32 | } catch (r) {
|
---|
33 | return err(r);
|
---|
34 | }
|
---|
35 | if (o !== n) throw o;
|
---|
36 | }
|
---|
37 | function err(e) {
|
---|
38 | return o = o !== n ? new r(o, e) : e, next();
|
---|
39 | }
|
---|
40 | return next();
|
---|
41 | }
|
---|
42 | };
|
---|
43 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.