@jsenv/core 29.1.19 → 29.2.0
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.
- package/dist/babel_helpers/AsyncGenerator/AsyncGenerator.js +3 -16
- package/dist/babel_helpers/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -5
- package/dist/babel_helpers/applyDecs/applyDecs.js +54 -241
- package/dist/babel_helpers/applyDecs2023/applyDecs2023.js +47 -195
- package/dist/babel_helpers/arrayLikeToArray/arrayLikeToArray.js +0 -2
- package/dist/babel_helpers/arrayWithoutHoles/arrayWithoutHoles.js +2 -1
- package/dist/babel_helpers/assertThisInitialized/assertThisInitialized.js +0 -1
- package/dist/babel_helpers/asyncGeneratorDelegate/asyncGeneratorDelegate.js +4 -14
- package/dist/babel_helpers/asyncIterator/asyncIterator.js +5 -20
- package/dist/babel_helpers/asyncToGenerator/asyncToGenerator.js +2 -8
- package/dist/babel_helpers/awaitAsyncGenerator/awaitAsyncGenerator.js +1 -3
- package/dist/babel_helpers/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -4
- package/dist/babel_helpers/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -1
- package/dist/babel_helpers/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -1
- package/dist/babel_helpers/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -1
- package/dist/babel_helpers/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -1
- package/dist/babel_helpers/classPrivateMethodGet/classPrivateMethodGet.js +0 -1
- package/dist/babel_helpers/construct/construct.js +5 -5
- package/dist/babel_helpers/createClass/createClass.js +0 -1
- package/dist/babel_helpers/createForOfIteratorHelper/createForOfIteratorHelper.js +5 -9
- package/dist/babel_helpers/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +2 -3
- package/dist/babel_helpers/createRawReactElement/createRawReactElement.js +2 -8
- package/dist/babel_helpers/createSuper/createSuper.js +2 -4
- package/dist/babel_helpers/decorate/decorate.js +60 -311
- package/dist/babel_helpers/defaults/defaults.js +0 -3
- package/dist/babel_helpers/defineEnumerableProperties/defineEnumerableProperties.js +2 -5
- package/dist/babel_helpers/defineProperty/defineProperty.js +0 -1
- package/dist/babel_helpers/extends/extends.js +0 -3
- package/dist/babel_helpers/get/get.js +0 -3
- package/dist/babel_helpers/getPrototypeOf/getPrototypeOf.js +2 -1
- package/dist/babel_helpers/inherits/inherits.js +2 -3
- package/dist/babel_helpers/instanceof/instanceof.js +0 -1
- package/dist/babel_helpers/interopRequireWildcard/interopRequireWildcard.js +0 -10
- package/dist/babel_helpers/isNativeReflectConstruct/isNativeReflectConstruct.js +6 -6
- package/dist/babel_helpers/iterableToArrayLimit/iterableToArrayLimit.js +0 -5
- package/dist/babel_helpers/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +2 -5
- package/dist/babel_helpers/jsx/jsx.js +2 -8
- package/dist/babel_helpers/maybeArrayLike/maybeArrayLike.js +2 -3
- package/dist/babel_helpers/objectSpread/objectSpread.js +4 -6
- package/dist/babel_helpers/objectSpread2/objectSpread2.js +3 -8
- package/dist/babel_helpers/objectWithoutProperties/objectWithoutProperties.js +0 -3
- package/dist/babel_helpers/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -2
- package/dist/babel_helpers/possibleConstructorReturn/possibleConstructorReturn.js +0 -1
- package/dist/babel_helpers/set/set.js +2 -12
- package/dist/babel_helpers/superPropBase/superPropBase.js +0 -1
- package/dist/babel_helpers/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -1
- package/dist/babel_helpers/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -1
- package/dist/babel_helpers/toPrimitive/toPrimitive.js +1 -5
- package/dist/babel_helpers/typeof/typeof.js +0 -2
- package/dist/babel_helpers/wrapNativeSuper/wrapNativeSuper.js +0 -7
- package/dist/babel_helpers/wrapRegExp/wrapRegExp.js +5 -19
- package/dist/controllable_child_process.mjs +17 -27
- package/dist/controllable_worker_thread.mjs +4 -16
- package/dist/js/autoreload.js +13 -56
- package/dist/js/execute_using_dynamic_import.js +40 -164
- package/dist/js/global_this.js +2 -10
- package/dist/js/import_meta_hot.js +3 -9
- package/dist/js/new_stylesheet.js +0 -59
- package/dist/js/regenerator_runtime.js +80 -156
- package/dist/js/s.js +25 -113
- package/dist/js/s.js.map +10 -10
- package/dist/js/script_type_module_supervisor.js +4 -13
- package/dist/js/server_events_client.js +10 -38
- package/dist/js/supervisor.js +25 -167
- package/dist/js/v8_coverage.js +29 -92
- package/dist/js/ws.js +226 -704
- package/dist/main.js +761 -4155
- package/package.json +2 -2
- package/src/plugins/import_meta_url/client/import_meta_url_browser.js +1 -2
- package/src/plugins/import_meta_url/client/import_meta_url_commonjs.mjs +1 -1
- package/src/plugins/plugins.js +1 -1
- package/src/plugins/transpilation/as_js_classic/helpers-string.js +1 -0
- package/src/plugins/transpilation/babel/global_this/client/global_this.js +0 -2
|
@@ -4,17 +4,16 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
|
|
7
8
|
var runtime = function (exports) {
|
|
8
9
|
|
|
9
10
|
var Op = Object.prototype;
|
|
10
11
|
var hasOwn = Op.hasOwnProperty;
|
|
11
12
|
var undefined$1; // More compressible than void 0.
|
|
12
|
-
|
|
13
13
|
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
14
14
|
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
15
15
|
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
16
16
|
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
17
|
-
|
|
18
17
|
function define(obj, key, value) {
|
|
19
18
|
Object.defineProperty(obj, key, {
|
|
20
19
|
value: value,
|
|
@@ -24,7 +23,6 @@ var runtime = function (exports) {
|
|
|
24
23
|
});
|
|
25
24
|
return obj[key];
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
try {
|
|
29
27
|
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
30
28
|
define({}, "");
|
|
@@ -33,19 +31,20 @@ var runtime = function (exports) {
|
|
|
33
31
|
return obj[key] = value;
|
|
34
32
|
};
|
|
35
33
|
}
|
|
36
|
-
|
|
37
34
|
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
38
35
|
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
39
36
|
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
40
37
|
var generator = Object.create(protoGenerator.prototype);
|
|
41
|
-
var context = new Context(tryLocsList || []);
|
|
42
|
-
// .throw, and .return methods.
|
|
38
|
+
var context = new Context(tryLocsList || []);
|
|
43
39
|
|
|
40
|
+
// The ._invoke method unifies the implementations of the .next,
|
|
41
|
+
// .throw, and .return methods.
|
|
44
42
|
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
45
43
|
return generator;
|
|
46
44
|
}
|
|
45
|
+
exports.wrap = wrap;
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
49
48
|
// record like context.tryEntries[i].completion. This interface could
|
|
50
49
|
// have been (and was previously) designed to take a closure to be
|
|
51
50
|
// invoked without arguments, but in all the cases we care about we
|
|
@@ -55,7 +54,6 @@ var runtime = function (exports) {
|
|
|
55
54
|
// in every case, so we don't have to touch the arguments object. The
|
|
56
55
|
// only additional allocation required is the completion record, which
|
|
57
56
|
// has a stable shape and so hopefully should be cheap to allocate.
|
|
58
|
-
|
|
59
57
|
function tryCatch(fn, obj, arg) {
|
|
60
58
|
try {
|
|
61
59
|
return {
|
|
@@ -69,47 +67,43 @@ var runtime = function (exports) {
|
|
|
69
67
|
};
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
|
-
|
|
73
70
|
var GenStateSuspendedStart = "suspendedStart";
|
|
74
71
|
var GenStateSuspendedYield = "suspendedYield";
|
|
75
72
|
var GenStateExecuting = "executing";
|
|
76
|
-
var GenStateCompleted = "completed";
|
|
73
|
+
var GenStateCompleted = "completed";
|
|
74
|
+
|
|
75
|
+
// Returning this object from the innerFn has the same effect as
|
|
77
76
|
// breaking out of the dispatch switch statement.
|
|
77
|
+
var ContinueSentinel = {};
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
// Dummy constructor functions that we use as the .constructor and
|
|
80
80
|
// .constructor.prototype properties for functions that return Generator
|
|
81
81
|
// objects. For full spec compliance, you may wish to configure your
|
|
82
82
|
// minifier not to mangle the names of these two functions.
|
|
83
|
-
|
|
84
83
|
function Generator() {}
|
|
85
|
-
|
|
86
84
|
function GeneratorFunction() {}
|
|
85
|
+
function GeneratorFunctionPrototype() {}
|
|
87
86
|
|
|
88
|
-
|
|
87
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
|
89
88
|
// don't natively support it.
|
|
90
|
-
|
|
91
|
-
|
|
92
89
|
var IteratorPrototype = {};
|
|
93
|
-
|
|
94
90
|
IteratorPrototype[iteratorSymbol] = function () {
|
|
95
91
|
return this;
|
|
96
92
|
};
|
|
97
|
-
|
|
98
93
|
var getProto = Object.getPrototypeOf;
|
|
99
94
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
100
|
-
|
|
101
95
|
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
102
96
|
// This environment has a native %IteratorPrototype%; use it instead
|
|
103
97
|
// of the polyfill.
|
|
104
98
|
IteratorPrototype = NativeIteratorPrototype;
|
|
105
99
|
}
|
|
106
|
-
|
|
107
100
|
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
108
101
|
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
109
102
|
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
110
|
-
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
|
|
111
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
103
|
+
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
|
|
112
104
|
|
|
105
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
|
106
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
113
107
|
function defineIteratorMethods(prototype) {
|
|
114
108
|
["next", "throw", "return"].forEach(function (method) {
|
|
115
109
|
define(prototype, method, function (arg) {
|
|
@@ -117,14 +111,13 @@ var runtime = function (exports) {
|
|
|
117
111
|
});
|
|
118
112
|
});
|
|
119
113
|
}
|
|
120
|
-
|
|
121
114
|
exports.isGeneratorFunction = function (genFun) {
|
|
122
115
|
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
123
|
-
return ctor ? ctor === GeneratorFunction ||
|
|
116
|
+
return ctor ? ctor === GeneratorFunction ||
|
|
117
|
+
// For the native GeneratorFunction constructor, the best we can
|
|
124
118
|
// do is to check its .name property.
|
|
125
119
|
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
|
126
120
|
};
|
|
127
|
-
|
|
128
121
|
exports.mark = function (genFun) {
|
|
129
122
|
if (Object.setPrototypeOf) {
|
|
130
123
|
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
@@ -132,31 +125,27 @@ var runtime = function (exports) {
|
|
|
132
125
|
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
133
126
|
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
134
127
|
}
|
|
135
|
-
|
|
136
128
|
genFun.prototype = Object.create(Gp);
|
|
137
129
|
return genFun;
|
|
138
|
-
};
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// Within the body of any async function, `await x` is transformed to
|
|
139
133
|
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
140
134
|
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
141
135
|
// meant to be awaited.
|
|
142
|
-
|
|
143
|
-
|
|
144
136
|
exports.awrap = function (arg) {
|
|
145
137
|
return {
|
|
146
138
|
__await: arg
|
|
147
139
|
};
|
|
148
140
|
};
|
|
149
|
-
|
|
150
141
|
function AsyncIterator(generator, PromiseImpl) {
|
|
151
142
|
function invoke(method, arg, resolve, reject) {
|
|
152
143
|
var record = tryCatch(generator[method], generator, arg);
|
|
153
|
-
|
|
154
144
|
if (record.type === "throw") {
|
|
155
145
|
reject(record.arg);
|
|
156
146
|
} else {
|
|
157
147
|
var result = record.arg;
|
|
158
148
|
var value = result.value;
|
|
159
|
-
|
|
160
149
|
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
|
|
161
150
|
return PromiseImpl.resolve(value.__await).then(function (value) {
|
|
162
151
|
invoke("next", value, resolve, reject);
|
|
@@ -164,7 +153,6 @@ var runtime = function (exports) {
|
|
|
164
153
|
invoke("throw", err, resolve, reject);
|
|
165
154
|
});
|
|
166
155
|
}
|
|
167
|
-
|
|
168
156
|
return PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
169
157
|
// When a yielded Promise is resolved, its final value becomes
|
|
170
158
|
// the .value of the Promise<{value,done}> result for the
|
|
@@ -178,17 +166,15 @@ var runtime = function (exports) {
|
|
|
178
166
|
});
|
|
179
167
|
}
|
|
180
168
|
}
|
|
181
|
-
|
|
182
169
|
var previousPromise;
|
|
183
|
-
|
|
184
170
|
function enqueue(method, arg) {
|
|
185
171
|
function callInvokeWithMethodAndArg() {
|
|
186
172
|
return new PromiseImpl(function (resolve, reject) {
|
|
187
173
|
invoke(method, arg, resolve, reject);
|
|
188
174
|
});
|
|
189
175
|
}
|
|
190
|
-
|
|
191
|
-
|
|
176
|
+
return previousPromise =
|
|
177
|
+
// If enqueue has been called before, then we want to wait until
|
|
192
178
|
// all previous Promises have been resolved before calling invoke,
|
|
193
179
|
// so that results are always delivered in the correct order. If
|
|
194
180
|
// enqueue has not been called before, then it is important to
|
|
@@ -200,26 +186,25 @@ var runtime = function (exports) {
|
|
|
200
186
|
// execute code before the first await. Since we implement simple
|
|
201
187
|
// async functions in terms of async generators, it is especially
|
|
202
188
|
// important to get this right, even though it requires care.
|
|
203
|
-
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
|
|
189
|
+
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
|
|
190
|
+
// Avoid propagating failures to Promises returned by later
|
|
204
191
|
// invocations of the iterator.
|
|
205
192
|
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
206
|
-
}
|
|
207
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
208
|
-
|
|
193
|
+
}
|
|
209
194
|
|
|
195
|
+
// Define the unified helper method that is used to implement .next,
|
|
196
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
210
197
|
this._invoke = enqueue;
|
|
211
198
|
}
|
|
212
|
-
|
|
213
199
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
214
|
-
|
|
215
200
|
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
216
201
|
return this;
|
|
217
202
|
};
|
|
203
|
+
exports.AsyncIterator = AsyncIterator;
|
|
218
204
|
|
|
219
|
-
|
|
205
|
+
// Note that simple async functions are implemented on top of
|
|
220
206
|
// AsyncIterator objects; they just return a Promise for the value of
|
|
221
207
|
// the final result produced by the iterator.
|
|
222
|
-
|
|
223
208
|
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
224
209
|
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
225
210
|
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
@@ -228,39 +213,32 @@ var runtime = function (exports) {
|
|
|
228
213
|
return result.done ? result.value : iter.next();
|
|
229
214
|
});
|
|
230
215
|
};
|
|
231
|
-
|
|
232
216
|
function makeInvokeMethod(innerFn, self, context) {
|
|
233
217
|
var state = GenStateSuspendedStart;
|
|
234
218
|
return function invoke(method, arg) {
|
|
235
219
|
if (state === GenStateExecuting) {
|
|
236
220
|
throw new Error("Generator is already running");
|
|
237
221
|
}
|
|
238
|
-
|
|
239
222
|
if (state === GenStateCompleted) {
|
|
240
223
|
if (method === "throw") {
|
|
241
224
|
throw arg;
|
|
242
|
-
}
|
|
243
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
244
|
-
|
|
225
|
+
}
|
|
245
226
|
|
|
227
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
228
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
246
229
|
return doneResult();
|
|
247
230
|
}
|
|
248
|
-
|
|
249
231
|
context.method = method;
|
|
250
232
|
context.arg = arg;
|
|
251
|
-
|
|
252
233
|
while (true) {
|
|
253
234
|
var delegate = context.delegate;
|
|
254
|
-
|
|
255
235
|
if (delegate) {
|
|
256
236
|
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
257
|
-
|
|
258
237
|
if (delegateResult) {
|
|
259
238
|
if (delegateResult === ContinueSentinel) continue;
|
|
260
239
|
return delegateResult;
|
|
261
240
|
}
|
|
262
241
|
}
|
|
263
|
-
|
|
264
242
|
if (context.method === "next") {
|
|
265
243
|
// Setting context._sent for legacy support of Babel's
|
|
266
244
|
// function.sent implementation.
|
|
@@ -270,51 +248,44 @@ var runtime = function (exports) {
|
|
|
270
248
|
state = GenStateCompleted;
|
|
271
249
|
throw context.arg;
|
|
272
250
|
}
|
|
273
|
-
|
|
274
251
|
context.dispatchException(context.arg);
|
|
275
252
|
} else if (context.method === "return") {
|
|
276
253
|
context.abrupt("return", context.arg);
|
|
277
254
|
}
|
|
278
|
-
|
|
279
255
|
state = GenStateExecuting;
|
|
280
256
|
var record = tryCatch(innerFn, self, context);
|
|
281
|
-
|
|
282
257
|
if (record.type === "normal") {
|
|
283
258
|
// If an exception is thrown from innerFn, we leave state ===
|
|
284
259
|
// GenStateExecuting and loop back for another invocation.
|
|
285
260
|
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
|
286
|
-
|
|
287
261
|
if (record.arg === ContinueSentinel) {
|
|
288
262
|
continue;
|
|
289
263
|
}
|
|
290
|
-
|
|
291
264
|
return {
|
|
292
265
|
value: record.arg,
|
|
293
266
|
done: context.done
|
|
294
267
|
};
|
|
295
268
|
} else if (record.type === "throw") {
|
|
296
|
-
state = GenStateCompleted;
|
|
269
|
+
state = GenStateCompleted;
|
|
270
|
+
// Dispatch the exception by looping back around to the
|
|
297
271
|
// context.dispatchException(context.arg) call above.
|
|
298
|
-
|
|
299
272
|
context.method = "throw";
|
|
300
273
|
context.arg = record.arg;
|
|
301
274
|
}
|
|
302
275
|
}
|
|
303
276
|
};
|
|
304
|
-
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
305
280
|
// result, either by returning a { value, done } result from the
|
|
306
281
|
// delegate iterator, or by modifying context.method and context.arg,
|
|
307
282
|
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
308
|
-
|
|
309
|
-
|
|
310
283
|
function maybeInvokeDelegate(delegate, context) {
|
|
311
284
|
var method = delegate.iterator[context.method];
|
|
312
|
-
|
|
313
285
|
if (method === undefined$1) {
|
|
314
286
|
// A .throw or .return when the delegate iterator has no .throw
|
|
315
287
|
// method always terminates the yield* loop.
|
|
316
288
|
context.delegate = null;
|
|
317
|
-
|
|
318
289
|
if (context.method === "throw") {
|
|
319
290
|
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
320
291
|
if (delegate.iterator["return"]) {
|
|
@@ -323,51 +294,45 @@ var runtime = function (exports) {
|
|
|
323
294
|
context.method = "return";
|
|
324
295
|
context.arg = undefined$1;
|
|
325
296
|
maybeInvokeDelegate(delegate, context);
|
|
326
|
-
|
|
327
297
|
if (context.method === "throw") {
|
|
328
298
|
// If maybeInvokeDelegate(context) changed context.method from
|
|
329
299
|
// "return" to "throw", let that override the TypeError below.
|
|
330
300
|
return ContinueSentinel;
|
|
331
301
|
}
|
|
332
302
|
}
|
|
333
|
-
|
|
334
303
|
context.method = "throw";
|
|
335
304
|
context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
336
305
|
}
|
|
337
|
-
|
|
338
306
|
return ContinueSentinel;
|
|
339
307
|
}
|
|
340
|
-
|
|
341
308
|
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
342
|
-
|
|
343
309
|
if (record.type === "throw") {
|
|
344
310
|
context.method = "throw";
|
|
345
311
|
context.arg = record.arg;
|
|
346
312
|
context.delegate = null;
|
|
347
313
|
return ContinueSentinel;
|
|
348
314
|
}
|
|
349
|
-
|
|
350
315
|
var info = record.arg;
|
|
351
|
-
|
|
352
316
|
if (!info) {
|
|
353
317
|
context.method = "throw";
|
|
354
318
|
context.arg = new TypeError("iterator result is not an object");
|
|
355
319
|
context.delegate = null;
|
|
356
320
|
return ContinueSentinel;
|
|
357
321
|
}
|
|
358
|
-
|
|
359
322
|
if (info.done) {
|
|
360
323
|
// Assign the result of the finished delegate to the temporary
|
|
361
324
|
// variable specified by delegate.resultName (see delegateYield).
|
|
362
|
-
context[delegate.resultName] = info.value;
|
|
325
|
+
context[delegate.resultName] = info.value;
|
|
326
|
+
|
|
327
|
+
// Resume execution at the desired location (see delegateYield).
|
|
328
|
+
context.next = delegate.nextLoc;
|
|
363
329
|
|
|
364
|
-
|
|
330
|
+
// If context.method was "throw" but the delegate handled the
|
|
365
331
|
// exception, let the outer generator proceed normally. If
|
|
366
332
|
// context.method was "next", forget context.arg since it has been
|
|
367
333
|
// "consumed" by the delegate iterator. If context.method was
|
|
368
334
|
// "return", allow the original .return call to continue in the
|
|
369
335
|
// outer generator.
|
|
370
|
-
|
|
371
336
|
if (context.method !== "return") {
|
|
372
337
|
context.method = "next";
|
|
373
338
|
context.arg = undefined$1;
|
|
@@ -375,55 +340,49 @@ var runtime = function (exports) {
|
|
|
375
340
|
} else {
|
|
376
341
|
// Re-yield the result returned by the delegate method.
|
|
377
342
|
return info;
|
|
378
|
-
}
|
|
379
|
-
// the outer generator.
|
|
380
|
-
|
|
343
|
+
}
|
|
381
344
|
|
|
345
|
+
// The delegate iterator is finished, so forget it and continue with
|
|
346
|
+
// the outer generator.
|
|
382
347
|
context.delegate = null;
|
|
383
348
|
return ContinueSentinel;
|
|
384
|
-
}
|
|
385
|
-
// unified ._invoke helper method.
|
|
386
|
-
|
|
349
|
+
}
|
|
387
350
|
|
|
351
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
352
|
+
// unified ._invoke helper method.
|
|
388
353
|
defineIteratorMethods(Gp);
|
|
389
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
354
|
+
define(Gp, toStringTagSymbol, "Generator");
|
|
355
|
+
|
|
356
|
+
// A Generator should always return itself as the iterator object when the
|
|
390
357
|
// @@iterator function is called on it. Some browsers' implementations of the
|
|
391
358
|
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
392
359
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
393
360
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
394
|
-
|
|
395
361
|
Gp[iteratorSymbol] = function () {
|
|
396
362
|
return this;
|
|
397
363
|
};
|
|
398
|
-
|
|
399
364
|
Gp.toString = function () {
|
|
400
365
|
return "[object Generator]";
|
|
401
366
|
};
|
|
402
|
-
|
|
403
367
|
function pushTryEntry(locs) {
|
|
404
368
|
var entry = {
|
|
405
369
|
tryLoc: locs[0]
|
|
406
370
|
};
|
|
407
|
-
|
|
408
371
|
if (1 in locs) {
|
|
409
372
|
entry.catchLoc = locs[1];
|
|
410
373
|
}
|
|
411
|
-
|
|
412
374
|
if (2 in locs) {
|
|
413
375
|
entry.finallyLoc = locs[2];
|
|
414
376
|
entry.afterLoc = locs[3];
|
|
415
377
|
}
|
|
416
|
-
|
|
417
378
|
this.tryEntries.push(entry);
|
|
418
379
|
}
|
|
419
|
-
|
|
420
380
|
function resetTryEntry(entry) {
|
|
421
381
|
var record = entry.completion || {};
|
|
422
382
|
record.type = "normal";
|
|
423
383
|
delete record.arg;
|
|
424
384
|
entry.completion = record;
|
|
425
385
|
}
|
|
426
|
-
|
|
427
386
|
function Context(tryLocsList) {
|
|
428
387
|
// The root entry object (effectively a try statement without a catch
|
|
429
388
|
// or a finally block) gives us a place to store values thrown from
|
|
@@ -434,97 +393,84 @@ var runtime = function (exports) {
|
|
|
434
393
|
tryLocsList.forEach(pushTryEntry, this);
|
|
435
394
|
this.reset(true);
|
|
436
395
|
}
|
|
437
|
-
|
|
438
396
|
exports.keys = function (object) {
|
|
439
397
|
var keys = [];
|
|
440
|
-
|
|
441
398
|
for (var key in object) {
|
|
442
399
|
keys.push(key);
|
|
443
400
|
}
|
|
401
|
+
keys.reverse();
|
|
444
402
|
|
|
445
|
-
|
|
403
|
+
// Rather than returning an object with a next method, we keep
|
|
446
404
|
// things simple and return the next function itself.
|
|
447
|
-
|
|
448
405
|
return function next() {
|
|
449
406
|
while (keys.length) {
|
|
450
407
|
var key = keys.pop();
|
|
451
|
-
|
|
452
408
|
if (key in object) {
|
|
453
409
|
next.value = key;
|
|
454
410
|
next.done = false;
|
|
455
411
|
return next;
|
|
456
412
|
}
|
|
457
|
-
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// To avoid creating an additional object, we just hang the .value
|
|
458
416
|
// and .done properties off the next function object itself. This
|
|
459
417
|
// also ensures that the minifier will not anonymize the function.
|
|
460
|
-
|
|
461
|
-
|
|
462
418
|
next.done = true;
|
|
463
419
|
return next;
|
|
464
420
|
};
|
|
465
421
|
};
|
|
466
|
-
|
|
467
422
|
function values(iterable) {
|
|
468
423
|
if (iterable) {
|
|
469
424
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
470
|
-
|
|
471
425
|
if (iteratorMethod) {
|
|
472
426
|
return iteratorMethod.call(iterable);
|
|
473
427
|
}
|
|
474
|
-
|
|
475
428
|
if (typeof iterable.next === "function") {
|
|
476
429
|
return iterable;
|
|
477
430
|
}
|
|
478
|
-
|
|
479
431
|
if (!isNaN(iterable.length)) {
|
|
480
432
|
var i = -1,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
433
|
+
next = function next() {
|
|
434
|
+
while (++i < iterable.length) {
|
|
435
|
+
if (hasOwn.call(iterable, i)) {
|
|
436
|
+
next.value = iterable[i];
|
|
437
|
+
next.done = false;
|
|
438
|
+
return next;
|
|
439
|
+
}
|
|
487
440
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
return next;
|
|
493
|
-
};
|
|
494
|
-
|
|
441
|
+
next.value = undefined$1;
|
|
442
|
+
next.done = true;
|
|
443
|
+
return next;
|
|
444
|
+
};
|
|
495
445
|
return next.next = next;
|
|
496
446
|
}
|
|
497
|
-
}
|
|
498
|
-
|
|
447
|
+
}
|
|
499
448
|
|
|
449
|
+
// Return an iterator with no values.
|
|
500
450
|
return {
|
|
501
451
|
next: doneResult
|
|
502
452
|
};
|
|
503
453
|
}
|
|
504
|
-
|
|
505
454
|
exports.values = values;
|
|
506
|
-
|
|
507
455
|
function doneResult() {
|
|
508
456
|
return {
|
|
509
457
|
value: undefined$1,
|
|
510
458
|
done: true
|
|
511
459
|
};
|
|
512
460
|
}
|
|
513
|
-
|
|
514
461
|
Context.prototype = {
|
|
515
462
|
constructor: Context,
|
|
516
463
|
reset: function (skipTempReset) {
|
|
517
464
|
this.prev = 0;
|
|
518
|
-
this.next = 0;
|
|
465
|
+
this.next = 0;
|
|
466
|
+
// Resetting context._sent for legacy support of Babel's
|
|
519
467
|
// function.sent implementation.
|
|
520
|
-
|
|
521
468
|
this.sent = this._sent = undefined$1;
|
|
522
469
|
this.done = false;
|
|
523
470
|
this.delegate = null;
|
|
524
471
|
this.method = "next";
|
|
525
472
|
this.arg = undefined$1;
|
|
526
473
|
this.tryEntries.forEach(resetTryEntry);
|
|
527
|
-
|
|
528
474
|
if (!skipTempReset) {
|
|
529
475
|
for (var name in this) {
|
|
530
476
|
// Not sure about the optimal order of these conditions:
|
|
@@ -538,50 +484,40 @@ var runtime = function (exports) {
|
|
|
538
484
|
this.done = true;
|
|
539
485
|
var rootEntry = this.tryEntries[0];
|
|
540
486
|
var rootRecord = rootEntry.completion;
|
|
541
|
-
|
|
542
487
|
if (rootRecord.type === "throw") {
|
|
543
488
|
throw rootRecord.arg;
|
|
544
489
|
}
|
|
545
|
-
|
|
546
490
|
return this.rval;
|
|
547
491
|
},
|
|
548
492
|
dispatchException: function (exception) {
|
|
549
493
|
if (this.done) {
|
|
550
494
|
throw exception;
|
|
551
495
|
}
|
|
552
|
-
|
|
553
496
|
var context = this;
|
|
554
|
-
|
|
555
497
|
function handle(loc, caught) {
|
|
556
498
|
record.type = "throw";
|
|
557
499
|
record.arg = exception;
|
|
558
500
|
context.next = loc;
|
|
559
|
-
|
|
560
501
|
if (caught) {
|
|
561
502
|
// If the dispatched exception was caught by a catch block,
|
|
562
503
|
// then let that catch block handle the exception normally.
|
|
563
504
|
context.method = "next";
|
|
564
505
|
context.arg = undefined$1;
|
|
565
506
|
}
|
|
566
|
-
|
|
567
507
|
return !!caught;
|
|
568
508
|
}
|
|
569
|
-
|
|
570
509
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
571
510
|
var entry = this.tryEntries[i];
|
|
572
511
|
var record = entry.completion;
|
|
573
|
-
|
|
574
512
|
if (entry.tryLoc === "root") {
|
|
575
513
|
// Exception thrown outside of any try block that could handle
|
|
576
514
|
// it, so set the completion value of the entire function to
|
|
577
515
|
// throw the exception.
|
|
578
516
|
return handle("end");
|
|
579
517
|
}
|
|
580
|
-
|
|
581
518
|
if (entry.tryLoc <= this.prev) {
|
|
582
519
|
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
583
520
|
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
584
|
-
|
|
585
521
|
if (hasCatch && hasFinally) {
|
|
586
522
|
if (this.prev < entry.catchLoc) {
|
|
587
523
|
return handle(entry.catchLoc, true);
|
|
@@ -605,36 +541,30 @@ var runtime = function (exports) {
|
|
|
605
541
|
abrupt: function (type, arg) {
|
|
606
542
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
607
543
|
var entry = this.tryEntries[i];
|
|
608
|
-
|
|
609
544
|
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
610
545
|
var finallyEntry = entry;
|
|
611
546
|
break;
|
|
612
547
|
}
|
|
613
548
|
}
|
|
614
|
-
|
|
615
549
|
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
|
616
550
|
// Ignore the finally entry if control is not jumping to a
|
|
617
551
|
// location outside the try/catch block.
|
|
618
552
|
finallyEntry = null;
|
|
619
553
|
}
|
|
620
|
-
|
|
621
554
|
var record = finallyEntry ? finallyEntry.completion : {};
|
|
622
555
|
record.type = type;
|
|
623
556
|
record.arg = arg;
|
|
624
|
-
|
|
625
557
|
if (finallyEntry) {
|
|
626
558
|
this.method = "next";
|
|
627
559
|
this.next = finallyEntry.finallyLoc;
|
|
628
560
|
return ContinueSentinel;
|
|
629
561
|
}
|
|
630
|
-
|
|
631
562
|
return this.complete(record);
|
|
632
563
|
},
|
|
633
564
|
complete: function (record, afterLoc) {
|
|
634
565
|
if (record.type === "throw") {
|
|
635
566
|
throw record.arg;
|
|
636
567
|
}
|
|
637
|
-
|
|
638
568
|
if (record.type === "break" || record.type === "continue") {
|
|
639
569
|
this.next = record.arg;
|
|
640
570
|
} else if (record.type === "return") {
|
|
@@ -644,13 +574,11 @@ var runtime = function (exports) {
|
|
|
644
574
|
} else if (record.type === "normal" && afterLoc) {
|
|
645
575
|
this.next = afterLoc;
|
|
646
576
|
}
|
|
647
|
-
|
|
648
577
|
return ContinueSentinel;
|
|
649
578
|
},
|
|
650
579
|
finish: function (finallyLoc) {
|
|
651
580
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
652
581
|
var entry = this.tryEntries[i];
|
|
653
|
-
|
|
654
582
|
if (entry.finallyLoc === finallyLoc) {
|
|
655
583
|
this.complete(entry.completion, entry.afterLoc);
|
|
656
584
|
resetTryEntry(entry);
|
|
@@ -661,21 +589,18 @@ var runtime = function (exports) {
|
|
|
661
589
|
"catch": function (tryLoc) {
|
|
662
590
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
663
591
|
var entry = this.tryEntries[i];
|
|
664
|
-
|
|
665
592
|
if (entry.tryLoc === tryLoc) {
|
|
666
593
|
var record = entry.completion;
|
|
667
|
-
|
|
668
594
|
if (record.type === "throw") {
|
|
669
595
|
var thrown = record.arg;
|
|
670
596
|
resetTryEntry(entry);
|
|
671
597
|
}
|
|
672
|
-
|
|
673
598
|
return thrown;
|
|
674
599
|
}
|
|
675
|
-
}
|
|
676
|
-
// argument that corresponds to a known catch block.
|
|
677
|
-
|
|
600
|
+
}
|
|
678
601
|
|
|
602
|
+
// The context.catch method must only be called with a location
|
|
603
|
+
// argument that corresponds to a known catch block.
|
|
679
604
|
throw new Error("illegal catch attempt");
|
|
680
605
|
},
|
|
681
606
|
delegateYield: function (iterable, resultName, nextLoc) {
|
|
@@ -684,27 +609,26 @@ var runtime = function (exports) {
|
|
|
684
609
|
resultName: resultName,
|
|
685
610
|
nextLoc: nextLoc
|
|
686
611
|
};
|
|
687
|
-
|
|
688
612
|
if (this.method === "next") {
|
|
689
613
|
// Deliberately forget the last sent value so that we don't
|
|
690
614
|
// accidentally pass it on to the delegate.
|
|
691
615
|
this.arg = undefined$1;
|
|
692
616
|
}
|
|
693
|
-
|
|
694
617
|
return ContinueSentinel;
|
|
695
618
|
}
|
|
696
|
-
};
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
// Regardless of whether this script is executing as a CommonJS module
|
|
697
622
|
// or not, return the runtime object so that we can declare the variable
|
|
698
623
|
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
699
624
|
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
700
|
-
|
|
701
625
|
return exports;
|
|
702
|
-
}(
|
|
626
|
+
}(
|
|
627
|
+
// If this script is executing as a CommonJS module, use module.exports
|
|
703
628
|
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
704
629
|
// object. Either way, the resulting object will be used to initialize
|
|
705
630
|
// the regeneratorRuntime variable at the top of this file.
|
|
706
631
|
typeof module === "object" ? module.exports : {});
|
|
707
|
-
|
|
708
632
|
try {
|
|
709
633
|
regeneratorRuntime = runtime;
|
|
710
634
|
} catch (accidentalStrictMode) {
|