@jsenv/core 40.3.1 → 40.3.3

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