@cubejs-client/ws-transport 1.2.22 → 1.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,114 +4,103 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CubejsWebSocketTransport = factory());
|
|
5
5
|
}(this, (function () { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _objectWithoutPropertiesLoose(
|
|
8
|
-
if (
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
14
|
-
key = sourceKeys[i];
|
|
15
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
16
|
-
target[key] = source[key];
|
|
7
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
8
|
+
if (null == r) return {};
|
|
9
|
+
var t = {};
|
|
10
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
11
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
12
|
+
t[n] = r[n];
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
return target;
|
|
14
|
+
return t;
|
|
20
15
|
}
|
|
21
16
|
|
|
22
|
-
function _objectWithoutProperties(
|
|
23
|
-
if (
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
function _objectWithoutProperties(e, t) {
|
|
18
|
+
if (null == e) return {};
|
|
19
|
+
var o,
|
|
20
|
+
r,
|
|
21
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
27
22
|
if (Object.getOwnPropertySymbols) {
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
31
|
-
key = sourceSymbolKeys[i];
|
|
32
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
33
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
34
|
-
target[key] = source[key];
|
|
35
|
-
}
|
|
23
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
24
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
return target;
|
|
26
|
+
return i;
|
|
39
27
|
}
|
|
40
28
|
|
|
41
|
-
function asyncGeneratorStep(
|
|
29
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
42
30
|
try {
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
} catch (
|
|
46
|
-
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (info.done) {
|
|
51
|
-
resolve(value);
|
|
52
|
-
} else {
|
|
53
|
-
Promise.resolve(value).then(_next, _throw);
|
|
31
|
+
var i = n[a](c),
|
|
32
|
+
u = i.value;
|
|
33
|
+
} catch (n) {
|
|
34
|
+
return void e(n);
|
|
54
35
|
}
|
|
36
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
55
37
|
}
|
|
56
|
-
|
|
57
|
-
function _asyncToGenerator(fn) {
|
|
38
|
+
function _asyncToGenerator(n) {
|
|
58
39
|
return function () {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
return new Promise(function (
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
40
|
+
var t = this,
|
|
41
|
+
e = arguments;
|
|
42
|
+
return new Promise(function (r, o) {
|
|
43
|
+
var a = n.apply(t, e);
|
|
44
|
+
function _next(n) {
|
|
45
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
66
46
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
47
|
+
function _throw(n) {
|
|
48
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
70
49
|
}
|
|
71
|
-
|
|
72
|
-
_next(undefined);
|
|
50
|
+
_next(void 0);
|
|
73
51
|
});
|
|
74
52
|
};
|
|
75
53
|
}
|
|
76
54
|
|
|
77
|
-
function _classCallCheck(
|
|
78
|
-
if (!(
|
|
79
|
-
|
|
80
|
-
|
|
55
|
+
function _classCallCheck(a, n) {
|
|
56
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function _typeof(o) {
|
|
60
|
+
"@babel/helpers - typeof";
|
|
61
|
+
|
|
62
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
63
|
+
return typeof o;
|
|
64
|
+
} : function (o) {
|
|
65
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
66
|
+
}, _typeof(o);
|
|
81
67
|
}
|
|
82
68
|
|
|
83
|
-
function
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if ("
|
|
89
|
-
|
|
69
|
+
function toPrimitive$1(t, r) {
|
|
70
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
71
|
+
var e = t[Symbol.toPrimitive];
|
|
72
|
+
if (void 0 !== e) {
|
|
73
|
+
var i = e.call(t, r || "default");
|
|
74
|
+
if ("object" != _typeof(i)) return i;
|
|
75
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
90
76
|
}
|
|
77
|
+
return ("string" === r ? String : Number)(t);
|
|
91
78
|
}
|
|
92
79
|
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
97
|
-
writable: false
|
|
98
|
-
});
|
|
99
|
-
return Constructor;
|
|
80
|
+
function toPropertyKey$1(t) {
|
|
81
|
+
var i = toPrimitive$1(t, "string");
|
|
82
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
100
83
|
}
|
|
101
84
|
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
enumerable: true,
|
|
107
|
-
configurable: true,
|
|
108
|
-
writable: true
|
|
109
|
-
});
|
|
110
|
-
} else {
|
|
111
|
-
obj[key] = value;
|
|
85
|
+
function _defineProperties(e, r) {
|
|
86
|
+
for (var t = 0; t < r.length; t++) {
|
|
87
|
+
var o = r[t];
|
|
88
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey$1(o.key), o);
|
|
112
89
|
}
|
|
90
|
+
}
|
|
91
|
+
function _createClass(e, r, t) {
|
|
92
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
93
|
+
writable: !1
|
|
94
|
+
}), e;
|
|
95
|
+
}
|
|
113
96
|
|
|
114
|
-
|
|
97
|
+
function _defineProperty(e, r, t) {
|
|
98
|
+
return (r = toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
99
|
+
value: t,
|
|
100
|
+
enumerable: !0,
|
|
101
|
+
configurable: !0,
|
|
102
|
+
writable: !0
|
|
103
|
+
}) : e[r] = t, e;
|
|
115
104
|
}
|
|
116
105
|
|
|
117
106
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -2466,763 +2455,340 @@
|
|
|
2466
2455
|
}
|
|
2467
2456
|
});
|
|
2468
2457
|
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
* This source code is licensed under the MIT license found in the
|
|
2473
|
-
* LICENSE file in the root directory of this source tree.
|
|
2474
|
-
*/
|
|
2475
|
-
|
|
2476
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
2477
|
-
var runtime = (function (exports) {
|
|
2458
|
+
var _typeof_1 = createCommonjsModule(function (module) {
|
|
2459
|
+
function _typeof(o) {
|
|
2460
|
+
"@babel/helpers - typeof";
|
|
2478
2461
|
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2462
|
+
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
2463
|
+
return typeof o;
|
|
2464
|
+
} : function (o) {
|
|
2465
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
2466
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
|
2467
|
+
}
|
|
2468
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2469
|
+
});
|
|
2486
2470
|
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2471
|
+
var regeneratorRuntime$1 = createCommonjsModule(function (module) {
|
|
2472
|
+
var _typeof = _typeof_1["default"];
|
|
2473
|
+
function _regeneratorRuntime() {
|
|
2474
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
2475
|
+
return e;
|
|
2476
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2477
|
+
var t,
|
|
2478
|
+
e = {},
|
|
2479
|
+
r = Object.prototype,
|
|
2480
|
+
n = r.hasOwnProperty,
|
|
2481
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
2482
|
+
t[e] = r.value;
|
|
2483
|
+
},
|
|
2484
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
2485
|
+
a = i.iterator || "@@iterator",
|
|
2486
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
2487
|
+
u = i.toStringTag || "@@toStringTag";
|
|
2488
|
+
function define(t, e, r) {
|
|
2489
|
+
return Object.defineProperty(t, e, {
|
|
2490
|
+
value: r,
|
|
2491
|
+
enumerable: !0,
|
|
2492
|
+
configurable: !0,
|
|
2493
|
+
writable: !0
|
|
2494
|
+
}), t[e];
|
|
2495
2495
|
}
|
|
2496
2496
|
try {
|
|
2497
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
2498
2497
|
define({}, "");
|
|
2499
|
-
} catch (
|
|
2500
|
-
define = function(
|
|
2501
|
-
return
|
|
2498
|
+
} catch (t) {
|
|
2499
|
+
define = function define(t, e, r) {
|
|
2500
|
+
return t[e] = r;
|
|
2502
2501
|
};
|
|
2503
2502
|
}
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
2512
|
-
// .throw, and .return methods.
|
|
2513
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
2514
|
-
|
|
2515
|
-
return generator;
|
|
2503
|
+
function wrap(t, e, r, n) {
|
|
2504
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
2505
|
+
a = Object.create(i.prototype),
|
|
2506
|
+
c = new Context(n || []);
|
|
2507
|
+
return o(a, "_invoke", {
|
|
2508
|
+
value: makeInvokeMethod(t, r, c)
|
|
2509
|
+
}), a;
|
|
2516
2510
|
}
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
2520
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
2521
|
-
// have been (and was previously) designed to take a closure to be
|
|
2522
|
-
// invoked without arguments, but in all the cases we care about we
|
|
2523
|
-
// already have an existing method we want to call, so there's no need
|
|
2524
|
-
// to create a new function object. We can even get away with assuming
|
|
2525
|
-
// the method takes exactly one argument, since that happens to be true
|
|
2526
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
2527
|
-
// only additional allocation required is the completion record, which
|
|
2528
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
2529
|
-
function tryCatch(fn, obj, arg) {
|
|
2511
|
+
function tryCatch(t, e, r) {
|
|
2530
2512
|
try {
|
|
2531
|
-
return {
|
|
2532
|
-
|
|
2533
|
-
|
|
2513
|
+
return {
|
|
2514
|
+
type: "normal",
|
|
2515
|
+
arg: t.call(e, r)
|
|
2516
|
+
};
|
|
2517
|
+
} catch (t) {
|
|
2518
|
+
return {
|
|
2519
|
+
type: "throw",
|
|
2520
|
+
arg: t
|
|
2521
|
+
};
|
|
2534
2522
|
}
|
|
2535
2523
|
}
|
|
2536
|
-
|
|
2537
|
-
var
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
// Returning this object from the innerFn has the same effect as
|
|
2543
|
-
// breaking out of the dispatch switch statement.
|
|
2544
|
-
var ContinueSentinel = {};
|
|
2545
|
-
|
|
2546
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
2547
|
-
// .constructor.prototype properties for functions that return Generator
|
|
2548
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
2549
|
-
// minifier not to mangle the names of these two functions.
|
|
2524
|
+
e.wrap = wrap;
|
|
2525
|
+
var h = "suspendedStart",
|
|
2526
|
+
l = "suspendedYield",
|
|
2527
|
+
f = "executing",
|
|
2528
|
+
s = "completed",
|
|
2529
|
+
y = {};
|
|
2550
2530
|
function Generator() {}
|
|
2551
2531
|
function GeneratorFunction() {}
|
|
2552
2532
|
function GeneratorFunctionPrototype() {}
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
// don't natively support it.
|
|
2556
|
-
var IteratorPrototype = {};
|
|
2557
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
2533
|
+
var p = {};
|
|
2534
|
+
define(p, a, function () {
|
|
2558
2535
|
return this;
|
|
2559
2536
|
});
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
2569
|
-
}
|
|
2570
|
-
|
|
2571
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
2572
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
2573
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
2574
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
2575
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
2576
|
-
GeneratorFunction.displayName = define(
|
|
2577
|
-
GeneratorFunctionPrototype,
|
|
2578
|
-
toStringTagSymbol,
|
|
2579
|
-
"GeneratorFunction"
|
|
2580
|
-
);
|
|
2581
|
-
|
|
2582
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
2583
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
2584
|
-
function defineIteratorMethods(prototype) {
|
|
2585
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
2586
|
-
define(prototype, method, function(arg) {
|
|
2587
|
-
return this._invoke(method, arg);
|
|
2537
|
+
var d = Object.getPrototypeOf,
|
|
2538
|
+
v = d && d(d(values([])));
|
|
2539
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
2540
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
2541
|
+
function defineIteratorMethods(t) {
|
|
2542
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
2543
|
+
define(t, e, function (t) {
|
|
2544
|
+
return this._invoke(e, t);
|
|
2588
2545
|
});
|
|
2589
2546
|
});
|
|
2590
2547
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
} else {
|
|
2606
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
2607
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
2608
|
-
}
|
|
2609
|
-
genFun.prototype = Object.create(Gp);
|
|
2610
|
-
return genFun;
|
|
2611
|
-
};
|
|
2612
|
-
|
|
2613
|
-
// Within the body of any async function, `await x` is transformed to
|
|
2614
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
2615
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
2616
|
-
// meant to be awaited.
|
|
2617
|
-
exports.awrap = function(arg) {
|
|
2618
|
-
return { __await: arg };
|
|
2619
|
-
};
|
|
2620
|
-
|
|
2621
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
2622
|
-
function invoke(method, arg, resolve, reject) {
|
|
2623
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
2624
|
-
if (record.type === "throw") {
|
|
2625
|
-
reject(record.arg);
|
|
2626
|
-
} else {
|
|
2627
|
-
var result = record.arg;
|
|
2628
|
-
var value = result.value;
|
|
2629
|
-
if (value &&
|
|
2630
|
-
typeof value === "object" &&
|
|
2631
|
-
hasOwn.call(value, "__await")) {
|
|
2632
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
2633
|
-
invoke("next", value, resolve, reject);
|
|
2634
|
-
}, function(err) {
|
|
2635
|
-
invoke("throw", err, resolve, reject);
|
|
2636
|
-
});
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
2640
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
2641
|
-
// the .value of the Promise<{value,done}> result for the
|
|
2642
|
-
// current iteration.
|
|
2643
|
-
result.value = unwrapped;
|
|
2644
|
-
resolve(result);
|
|
2645
|
-
}, function(error) {
|
|
2646
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
2647
|
-
// into the async generator function so it can be handled there.
|
|
2648
|
-
return invoke("throw", error, resolve, reject);
|
|
2548
|
+
function AsyncIterator(t, e) {
|
|
2549
|
+
function invoke(r, o, i, a) {
|
|
2550
|
+
var c = tryCatch(t[r], t, o);
|
|
2551
|
+
if ("throw" !== c.type) {
|
|
2552
|
+
var u = c.arg,
|
|
2553
|
+
h = u.value;
|
|
2554
|
+
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
2555
|
+
invoke("next", t, i, a);
|
|
2556
|
+
}, function (t) {
|
|
2557
|
+
invoke("throw", t, i, a);
|
|
2558
|
+
}) : e.resolve(h).then(function (t) {
|
|
2559
|
+
u.value = t, i(u);
|
|
2560
|
+
}, function (t) {
|
|
2561
|
+
return invoke("throw", t, i, a);
|
|
2649
2562
|
});
|
|
2650
2563
|
}
|
|
2564
|
+
a(c.arg);
|
|
2651
2565
|
}
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
}
|
|
2566
|
+
var r;
|
|
2567
|
+
o(this, "_invoke", {
|
|
2568
|
+
value: function value(t, n) {
|
|
2569
|
+
function callInvokeWithMethodAndArg() {
|
|
2570
|
+
return new e(function (e, r) {
|
|
2571
|
+
invoke(t, n, e, r);
|
|
2572
|
+
});
|
|
2573
|
+
}
|
|
2574
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
2660
2575
|
}
|
|
2661
|
-
|
|
2662
|
-
return previousPromise =
|
|
2663
|
-
// If enqueue has been called before, then we want to wait until
|
|
2664
|
-
// all previous Promises have been resolved before calling invoke,
|
|
2665
|
-
// so that results are always delivered in the correct order. If
|
|
2666
|
-
// enqueue has not been called before, then it is important to
|
|
2667
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
2668
|
-
// so that the async generator function has the opportunity to do
|
|
2669
|
-
// any necessary setup in a predictable way. This predictability
|
|
2670
|
-
// is why the Promise constructor synchronously invokes its
|
|
2671
|
-
// executor callback, and why async functions synchronously
|
|
2672
|
-
// execute code before the first await. Since we implement simple
|
|
2673
|
-
// async functions in terms of async generators, it is especially
|
|
2674
|
-
// important to get this right, even though it requires care.
|
|
2675
|
-
previousPromise ? previousPromise.then(
|
|
2676
|
-
callInvokeWithMethodAndArg,
|
|
2677
|
-
// Avoid propagating failures to Promises returned by later
|
|
2678
|
-
// invocations of the iterator.
|
|
2679
|
-
callInvokeWithMethodAndArg
|
|
2680
|
-
) : callInvokeWithMethodAndArg();
|
|
2681
|
-
}
|
|
2682
|
-
|
|
2683
|
-
// Define the unified helper method that is used to implement .next,
|
|
2684
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
2685
|
-
this._invoke = enqueue;
|
|
2576
|
+
});
|
|
2686
2577
|
}
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
2698
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
2699
|
-
|
|
2700
|
-
var iter = new AsyncIterator(
|
|
2701
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
2702
|
-
PromiseImpl
|
|
2703
|
-
);
|
|
2704
|
-
|
|
2705
|
-
return exports.isGeneratorFunction(outerFn)
|
|
2706
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
2707
|
-
: iter.next().then(function(result) {
|
|
2708
|
-
return result.done ? result.value : iter.next();
|
|
2709
|
-
});
|
|
2710
|
-
};
|
|
2711
|
-
|
|
2712
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
2713
|
-
var state = GenStateSuspendedStart;
|
|
2714
|
-
|
|
2715
|
-
return function invoke(method, arg) {
|
|
2716
|
-
if (state === GenStateExecuting) {
|
|
2717
|
-
throw new Error("Generator is already running");
|
|
2718
|
-
}
|
|
2719
|
-
|
|
2720
|
-
if (state === GenStateCompleted) {
|
|
2721
|
-
if (method === "throw") {
|
|
2722
|
-
throw arg;
|
|
2723
|
-
}
|
|
2724
|
-
|
|
2725
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
2726
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
2727
|
-
return doneResult();
|
|
2578
|
+
function makeInvokeMethod(e, r, n) {
|
|
2579
|
+
var o = h;
|
|
2580
|
+
return function (i, a) {
|
|
2581
|
+
if (o === f) throw Error("Generator is already running");
|
|
2582
|
+
if (o === s) {
|
|
2583
|
+
if ("throw" === i) throw a;
|
|
2584
|
+
return {
|
|
2585
|
+
value: t,
|
|
2586
|
+
done: !0
|
|
2587
|
+
};
|
|
2728
2588
|
}
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
2737
|
-
if (delegateResult) {
|
|
2738
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
2739
|
-
return delegateResult;
|
|
2589
|
+
for (n.method = i, n.arg = a;;) {
|
|
2590
|
+
var c = n.delegate;
|
|
2591
|
+
if (c) {
|
|
2592
|
+
var u = maybeInvokeDelegate(c, n);
|
|
2593
|
+
if (u) {
|
|
2594
|
+
if (u === y) continue;
|
|
2595
|
+
return u;
|
|
2740
2596
|
}
|
|
2741
2597
|
}
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
if (
|
|
2750
|
-
state = GenStateCompleted;
|
|
2751
|
-
throw context.arg;
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2754
|
-
context.dispatchException(context.arg);
|
|
2755
|
-
|
|
2756
|
-
} else if (context.method === "return") {
|
|
2757
|
-
context.abrupt("return", context.arg);
|
|
2758
|
-
}
|
|
2759
|
-
|
|
2760
|
-
state = GenStateExecuting;
|
|
2761
|
-
|
|
2762
|
-
var record = tryCatch(innerFn, self, context);
|
|
2763
|
-
if (record.type === "normal") {
|
|
2764
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
2765
|
-
// GenStateExecuting and loop back for another invocation.
|
|
2766
|
-
state = context.done
|
|
2767
|
-
? GenStateCompleted
|
|
2768
|
-
: GenStateSuspendedYield;
|
|
2769
|
-
|
|
2770
|
-
if (record.arg === ContinueSentinel) {
|
|
2771
|
-
continue;
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2598
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
2599
|
+
if (o === h) throw o = s, n.arg;
|
|
2600
|
+
n.dispatchException(n.arg);
|
|
2601
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
2602
|
+
o = f;
|
|
2603
|
+
var p = tryCatch(e, r, n);
|
|
2604
|
+
if ("normal" === p.type) {
|
|
2605
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
2774
2606
|
return {
|
|
2775
|
-
value:
|
|
2776
|
-
done:
|
|
2607
|
+
value: p.arg,
|
|
2608
|
+
done: n.done
|
|
2777
2609
|
};
|
|
2778
|
-
|
|
2779
|
-
} else if (record.type === "throw") {
|
|
2780
|
-
state = GenStateCompleted;
|
|
2781
|
-
// Dispatch the exception by looping back around to the
|
|
2782
|
-
// context.dispatchException(context.arg) call above.
|
|
2783
|
-
context.method = "throw";
|
|
2784
|
-
context.arg = record.arg;
|
|
2785
2610
|
}
|
|
2611
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
2786
2612
|
}
|
|
2787
2613
|
};
|
|
2788
2614
|
}
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
var
|
|
2796
|
-
|
|
2797
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
2798
|
-
// method always terminates the yield* loop.
|
|
2799
|
-
context.delegate = null;
|
|
2800
|
-
|
|
2801
|
-
if (context.method === "throw") {
|
|
2802
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
2803
|
-
if (delegate.iterator["return"]) {
|
|
2804
|
-
// If the delegate iterator has a return method, give it a
|
|
2805
|
-
// chance to clean up.
|
|
2806
|
-
context.method = "return";
|
|
2807
|
-
context.arg = undefined$1;
|
|
2808
|
-
maybeInvokeDelegate(delegate, context);
|
|
2809
|
-
|
|
2810
|
-
if (context.method === "throw") {
|
|
2811
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
2812
|
-
// "return" to "throw", let that override the TypeError below.
|
|
2813
|
-
return ContinueSentinel;
|
|
2814
|
-
}
|
|
2815
|
-
}
|
|
2816
|
-
|
|
2817
|
-
context.method = "throw";
|
|
2818
|
-
context.arg = new TypeError(
|
|
2819
|
-
"The iterator does not provide a 'throw' method");
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2822
|
-
return ContinueSentinel;
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
2826
|
-
|
|
2827
|
-
if (record.type === "throw") {
|
|
2828
|
-
context.method = "throw";
|
|
2829
|
-
context.arg = record.arg;
|
|
2830
|
-
context.delegate = null;
|
|
2831
|
-
return ContinueSentinel;
|
|
2832
|
-
}
|
|
2833
|
-
|
|
2834
|
-
var info = record.arg;
|
|
2835
|
-
|
|
2836
|
-
if (! info) {
|
|
2837
|
-
context.method = "throw";
|
|
2838
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
2839
|
-
context.delegate = null;
|
|
2840
|
-
return ContinueSentinel;
|
|
2841
|
-
}
|
|
2842
|
-
|
|
2843
|
-
if (info.done) {
|
|
2844
|
-
// Assign the result of the finished delegate to the temporary
|
|
2845
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
2846
|
-
context[delegate.resultName] = info.value;
|
|
2847
|
-
|
|
2848
|
-
// Resume execution at the desired location (see delegateYield).
|
|
2849
|
-
context.next = delegate.nextLoc;
|
|
2850
|
-
|
|
2851
|
-
// If context.method was "throw" but the delegate handled the
|
|
2852
|
-
// exception, let the outer generator proceed normally. If
|
|
2853
|
-
// context.method was "next", forget context.arg since it has been
|
|
2854
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
2855
|
-
// "return", allow the original .return call to continue in the
|
|
2856
|
-
// outer generator.
|
|
2857
|
-
if (context.method !== "return") {
|
|
2858
|
-
context.method = "next";
|
|
2859
|
-
context.arg = undefined$1;
|
|
2860
|
-
}
|
|
2861
|
-
|
|
2862
|
-
} else {
|
|
2863
|
-
// Re-yield the result returned by the delegate method.
|
|
2864
|
-
return info;
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
2868
|
-
// the outer generator.
|
|
2869
|
-
context.delegate = null;
|
|
2870
|
-
return ContinueSentinel;
|
|
2615
|
+
function maybeInvokeDelegate(e, r) {
|
|
2616
|
+
var n = r.method,
|
|
2617
|
+
o = e.iterator[n];
|
|
2618
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
2619
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
2620
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
2621
|
+
var a = i.arg;
|
|
2622
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
2871
2623
|
}
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
2878
|
-
|
|
2879
|
-
// A Generator should always return itself as the iterator object when the
|
|
2880
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
2881
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
2882
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
2883
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
2884
|
-
define(Gp, iteratorSymbol, function() {
|
|
2885
|
-
return this;
|
|
2886
|
-
});
|
|
2887
|
-
|
|
2888
|
-
define(Gp, "toString", function() {
|
|
2889
|
-
return "[object Generator]";
|
|
2890
|
-
});
|
|
2891
|
-
|
|
2892
|
-
function pushTryEntry(locs) {
|
|
2893
|
-
var entry = { tryLoc: locs[0] };
|
|
2894
|
-
|
|
2895
|
-
if (1 in locs) {
|
|
2896
|
-
entry.catchLoc = locs[1];
|
|
2897
|
-
}
|
|
2898
|
-
|
|
2899
|
-
if (2 in locs) {
|
|
2900
|
-
entry.finallyLoc = locs[2];
|
|
2901
|
-
entry.afterLoc = locs[3];
|
|
2902
|
-
}
|
|
2903
|
-
|
|
2904
|
-
this.tryEntries.push(entry);
|
|
2624
|
+
function pushTryEntry(t) {
|
|
2625
|
+
var e = {
|
|
2626
|
+
tryLoc: t[0]
|
|
2627
|
+
};
|
|
2628
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
2905
2629
|
}
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
record.type = "normal";
|
|
2910
|
-
delete record.arg;
|
|
2911
|
-
entry.completion = record;
|
|
2630
|
+
function resetTryEntry(t) {
|
|
2631
|
+
var e = t.completion || {};
|
|
2632
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
2912
2633
|
}
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
// locations where there is no enclosing try statement.
|
|
2918
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
2919
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
2920
|
-
this.reset(true);
|
|
2634
|
+
function Context(t) {
|
|
2635
|
+
this.tryEntries = [{
|
|
2636
|
+
tryLoc: "root"
|
|
2637
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
2921
2638
|
}
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
var key = keys.pop();
|
|
2935
|
-
if (key in object) {
|
|
2936
|
-
next.value = key;
|
|
2937
|
-
next.done = false;
|
|
2938
|
-
return next;
|
|
2939
|
-
}
|
|
2940
|
-
}
|
|
2941
|
-
|
|
2942
|
-
// To avoid creating an additional object, we just hang the .value
|
|
2943
|
-
// and .done properties off the next function object itself. This
|
|
2944
|
-
// also ensures that the minifier will not anonymize the function.
|
|
2945
|
-
next.done = true;
|
|
2946
|
-
return next;
|
|
2947
|
-
};
|
|
2948
|
-
};
|
|
2949
|
-
|
|
2950
|
-
function values(iterable) {
|
|
2951
|
-
if (iterable) {
|
|
2952
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
2953
|
-
if (iteratorMethod) {
|
|
2954
|
-
return iteratorMethod.call(iterable);
|
|
2955
|
-
}
|
|
2956
|
-
|
|
2957
|
-
if (typeof iterable.next === "function") {
|
|
2958
|
-
return iterable;
|
|
2959
|
-
}
|
|
2960
|
-
|
|
2961
|
-
if (!isNaN(iterable.length)) {
|
|
2962
|
-
var i = -1, next = function next() {
|
|
2963
|
-
while (++i < iterable.length) {
|
|
2964
|
-
if (hasOwn.call(iterable, i)) {
|
|
2965
|
-
next.value = iterable[i];
|
|
2966
|
-
next.done = false;
|
|
2967
|
-
return next;
|
|
2968
|
-
}
|
|
2969
|
-
}
|
|
2970
|
-
|
|
2971
|
-
next.value = undefined$1;
|
|
2972
|
-
next.done = true;
|
|
2973
|
-
|
|
2974
|
-
return next;
|
|
2975
|
-
};
|
|
2976
|
-
|
|
2977
|
-
return next.next = next;
|
|
2639
|
+
function values(e) {
|
|
2640
|
+
if (e || "" === e) {
|
|
2641
|
+
var r = e[a];
|
|
2642
|
+
if (r) return r.call(e);
|
|
2643
|
+
if ("function" == typeof e.next) return e;
|
|
2644
|
+
if (!isNaN(e.length)) {
|
|
2645
|
+
var o = -1,
|
|
2646
|
+
i = function next() {
|
|
2647
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
2648
|
+
return next.value = t, next.done = !0, next;
|
|
2649
|
+
};
|
|
2650
|
+
return i.next = i;
|
|
2978
2651
|
}
|
|
2979
2652
|
}
|
|
2980
|
-
|
|
2981
|
-
// Return an iterator with no values.
|
|
2982
|
-
return { next: doneResult };
|
|
2653
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
2983
2654
|
}
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
constructor
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
2655
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
2656
|
+
value: GeneratorFunctionPrototype,
|
|
2657
|
+
configurable: !0
|
|
2658
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
2659
|
+
value: GeneratorFunction,
|
|
2660
|
+
configurable: !0
|
|
2661
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
2662
|
+
var e = "function" == typeof t && t.constructor;
|
|
2663
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
2664
|
+
}, e.mark = function (t) {
|
|
2665
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
2666
|
+
}, e.awrap = function (t) {
|
|
2667
|
+
return {
|
|
2668
|
+
__await: t
|
|
2669
|
+
};
|
|
2670
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
2671
|
+
return this;
|
|
2672
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
2673
|
+
void 0 === i && (i = Promise);
|
|
2674
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
2675
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
2676
|
+
return t.done ? t.value : a.next();
|
|
2677
|
+
});
|
|
2678
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
2679
|
+
return this;
|
|
2680
|
+
}), define(g, "toString", function () {
|
|
2681
|
+
return "[object Generator]";
|
|
2682
|
+
}), e.keys = function (t) {
|
|
2683
|
+
var e = Object(t),
|
|
2684
|
+
r = [];
|
|
2685
|
+
for (var n in e) r.push(n);
|
|
2686
|
+
return r.reverse(), function next() {
|
|
2687
|
+
for (; r.length;) {
|
|
2688
|
+
var t = r.pop();
|
|
2689
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
3016
2690
|
}
|
|
2691
|
+
return next.done = !0, next;
|
|
2692
|
+
};
|
|
2693
|
+
}, e.values = values, Context.prototype = {
|
|
2694
|
+
constructor: Context,
|
|
2695
|
+
reset: function reset(e) {
|
|
2696
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
3017
2697
|
},
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
var rootEntry = this.tryEntries[0];
|
|
3023
|
-
var rootRecord = rootEntry.completion;
|
|
3024
|
-
if (rootRecord.type === "throw") {
|
|
3025
|
-
throw rootRecord.arg;
|
|
3026
|
-
}
|
|
3027
|
-
|
|
2698
|
+
stop: function stop() {
|
|
2699
|
+
this.done = !0;
|
|
2700
|
+
var t = this.tryEntries[0].completion;
|
|
2701
|
+
if ("throw" === t.type) throw t.arg;
|
|
3028
2702
|
return this.rval;
|
|
3029
2703
|
},
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
2704
|
+
dispatchException: function dispatchException(e) {
|
|
2705
|
+
if (this.done) throw e;
|
|
2706
|
+
var r = this;
|
|
2707
|
+
function handle(n, o) {
|
|
2708
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
3034
2709
|
}
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
}
|
|
3048
|
-
|
|
3049
|
-
return !! caught;
|
|
3050
|
-
}
|
|
3051
|
-
|
|
3052
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3053
|
-
var entry = this.tryEntries[i];
|
|
3054
|
-
var record = entry.completion;
|
|
3055
|
-
|
|
3056
|
-
if (entry.tryLoc === "root") {
|
|
3057
|
-
// Exception thrown outside of any try block that could handle
|
|
3058
|
-
// it, so set the completion value of the entire function to
|
|
3059
|
-
// throw the exception.
|
|
3060
|
-
return handle("end");
|
|
3061
|
-
}
|
|
3062
|
-
|
|
3063
|
-
if (entry.tryLoc <= this.prev) {
|
|
3064
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
3065
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
3066
|
-
|
|
3067
|
-
if (hasCatch && hasFinally) {
|
|
3068
|
-
if (this.prev < entry.catchLoc) {
|
|
3069
|
-
return handle(entry.catchLoc, true);
|
|
3070
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
3071
|
-
return handle(entry.finallyLoc);
|
|
3072
|
-
}
|
|
3073
|
-
|
|
3074
|
-
} else if (hasCatch) {
|
|
3075
|
-
if (this.prev < entry.catchLoc) {
|
|
3076
|
-
return handle(entry.catchLoc, true);
|
|
3077
|
-
}
|
|
3078
|
-
|
|
3079
|
-
} else if (hasFinally) {
|
|
3080
|
-
if (this.prev < entry.finallyLoc) {
|
|
3081
|
-
return handle(entry.finallyLoc);
|
|
3082
|
-
}
|
|
3083
|
-
|
|
2710
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
2711
|
+
var i = this.tryEntries[o],
|
|
2712
|
+
a = i.completion;
|
|
2713
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
2714
|
+
if (i.tryLoc <= this.prev) {
|
|
2715
|
+
var c = n.call(i, "catchLoc"),
|
|
2716
|
+
u = n.call(i, "finallyLoc");
|
|
2717
|
+
if (c && u) {
|
|
2718
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
2719
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
2720
|
+
} else if (c) {
|
|
2721
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
3084
2722
|
} else {
|
|
3085
|
-
throw
|
|
2723
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
2724
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
3086
2725
|
}
|
|
3087
2726
|
}
|
|
3088
2727
|
}
|
|
3089
2728
|
},
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
3096
|
-
this.prev < entry.finallyLoc) {
|
|
3097
|
-
var finallyEntry = entry;
|
|
2729
|
+
abrupt: function abrupt(t, e) {
|
|
2730
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
2731
|
+
var o = this.tryEntries[r];
|
|
2732
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
2733
|
+
var i = o;
|
|
3098
2734
|
break;
|
|
3099
2735
|
}
|
|
3100
2736
|
}
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
type === "continue") &&
|
|
3105
|
-
finallyEntry.tryLoc <= arg &&
|
|
3106
|
-
arg <= finallyEntry.finallyLoc) {
|
|
3107
|
-
// Ignore the finally entry if control is not jumping to a
|
|
3108
|
-
// location outside the try/catch block.
|
|
3109
|
-
finallyEntry = null;
|
|
3110
|
-
}
|
|
3111
|
-
|
|
3112
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
3113
|
-
record.type = type;
|
|
3114
|
-
record.arg = arg;
|
|
3115
|
-
|
|
3116
|
-
if (finallyEntry) {
|
|
3117
|
-
this.method = "next";
|
|
3118
|
-
this.next = finallyEntry.finallyLoc;
|
|
3119
|
-
return ContinueSentinel;
|
|
3120
|
-
}
|
|
3121
|
-
|
|
3122
|
-
return this.complete(record);
|
|
2737
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
2738
|
+
var a = i ? i.completion : {};
|
|
2739
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
3123
2740
|
},
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
throw record.arg;
|
|
3128
|
-
}
|
|
3129
|
-
|
|
3130
|
-
if (record.type === "break" ||
|
|
3131
|
-
record.type === "continue") {
|
|
3132
|
-
this.next = record.arg;
|
|
3133
|
-
} else if (record.type === "return") {
|
|
3134
|
-
this.rval = this.arg = record.arg;
|
|
3135
|
-
this.method = "return";
|
|
3136
|
-
this.next = "end";
|
|
3137
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
3138
|
-
this.next = afterLoc;
|
|
3139
|
-
}
|
|
3140
|
-
|
|
3141
|
-
return ContinueSentinel;
|
|
2741
|
+
complete: function complete(t, e) {
|
|
2742
|
+
if ("throw" === t.type) throw t.arg;
|
|
2743
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
3142
2744
|
},
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
3148
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
3149
|
-
resetTryEntry(entry);
|
|
3150
|
-
return ContinueSentinel;
|
|
3151
|
-
}
|
|
2745
|
+
finish: function finish(t) {
|
|
2746
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
2747
|
+
var r = this.tryEntries[e];
|
|
2748
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
3152
2749
|
}
|
|
3153
2750
|
},
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
resetTryEntry(entry);
|
|
2751
|
+
"catch": function _catch(t) {
|
|
2752
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
2753
|
+
var r = this.tryEntries[e];
|
|
2754
|
+
if (r.tryLoc === t) {
|
|
2755
|
+
var n = r.completion;
|
|
2756
|
+
if ("throw" === n.type) {
|
|
2757
|
+
var o = n.arg;
|
|
2758
|
+
resetTryEntry(r);
|
|
3163
2759
|
}
|
|
3164
|
-
return
|
|
2760
|
+
return o;
|
|
3165
2761
|
}
|
|
3166
2762
|
}
|
|
3167
|
-
|
|
3168
|
-
// The context.catch method must only be called with a location
|
|
3169
|
-
// argument that corresponds to a known catch block.
|
|
3170
|
-
throw new Error("illegal catch attempt");
|
|
2763
|
+
throw Error("illegal catch attempt");
|
|
3171
2764
|
},
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
};
|
|
3179
|
-
|
|
3180
|
-
if (this.method === "next") {
|
|
3181
|
-
// Deliberately forget the last sent value so that we don't
|
|
3182
|
-
// accidentally pass it on to the delegate.
|
|
3183
|
-
this.arg = undefined$1;
|
|
3184
|
-
}
|
|
3185
|
-
|
|
3186
|
-
return ContinueSentinel;
|
|
2765
|
+
delegateYield: function delegateYield(e, r, n) {
|
|
2766
|
+
return this.delegate = {
|
|
2767
|
+
iterator: values(e),
|
|
2768
|
+
resultName: r,
|
|
2769
|
+
nextLoc: n
|
|
2770
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
3187
2771
|
}
|
|
3188
|
-
};
|
|
2772
|
+
}, e;
|
|
2773
|
+
}
|
|
2774
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2775
|
+
});
|
|
3189
2776
|
|
|
3190
|
-
|
|
3191
|
-
// or not, return the runtime object so that we can declare the variable
|
|
3192
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
3193
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
3194
|
-
return exports;
|
|
2777
|
+
// TODO(Babel 8): Remove this file.
|
|
3195
2778
|
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
3199
|
-
// object. Either way, the resulting object will be used to initialize
|
|
3200
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
3201
|
-
module.exports
|
|
3202
|
-
));
|
|
2779
|
+
var runtime = regeneratorRuntime$1();
|
|
2780
|
+
var regenerator = runtime;
|
|
3203
2781
|
|
|
2782
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
3204
2783
|
try {
|
|
3205
2784
|
regeneratorRuntime = runtime;
|
|
3206
2785
|
} catch (accidentalStrictMode) {
|
|
3207
|
-
// This module should not be running in strict mode, so the above
|
|
3208
|
-
// assignment should always work unless something is misconfigured. Just
|
|
3209
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
3210
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
3211
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
3212
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
3213
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
3214
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
3215
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
3216
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
3217
2786
|
if (typeof globalThis === "object") {
|
|
3218
2787
|
globalThis.regeneratorRuntime = runtime;
|
|
3219
2788
|
} else {
|
|
3220
2789
|
Function("r", "regeneratorRuntime = r")(runtime);
|
|
3221
2790
|
}
|
|
3222
2791
|
}
|
|
3223
|
-
});
|
|
3224
|
-
|
|
3225
|
-
var regenerator = runtime_1;
|
|
3226
2792
|
|
|
3227
2793
|
// https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js
|
|
3228
2794
|
|