@jsenv/core 40.3.2 → 40.4.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.
Files changed (123) hide show
  1. package/dist/build/browserslist_index/browserslist_index.js +4951 -0
  2. package/dist/build/build.js +228 -83
  3. package/dist/build/jsenv_core_node_modules.js +709 -0
  4. package/dist/build/jsenv_core_packages.js +10915 -0
  5. package/dist/start_build_server/jsenv_core_node_modules.js +685 -0
  6. package/dist/start_build_server/jsenv_core_packages.js +1550 -0
  7. package/dist/start_build_server/start_build_server.js +2 -9
  8. package/dist/start_dev_server/jsenv_core_node_modules.js +685 -0
  9. package/dist/start_dev_server/jsenv_core_packages.js +6185 -0
  10. package/dist/start_dev_server/start_dev_server.js +109 -75
  11. package/package.json +20 -20
  12. package/src/build/build.js +79 -0
  13. package/src/build/build_specifier_manager.js +2 -2
  14. package/src/build/build_urls_generator.js +42 -5
  15. package/src/kitchen/errors.js +6 -1
  16. package/src/kitchen/kitchen.js +95 -7
  17. package/src/plugins/package_side_effects/jsenv_plugin_package_side_effects.js +5 -65
  18. package/dist/babel_helpers/AsyncGenerator/AsyncGenerator.js +0 -112
  19. package/dist/babel_helpers/AwaitValue/AwaitValue.js +0 -3
  20. package/dist/babel_helpers/OverloadYield/OverloadYield.js +0 -11
  21. package/dist/babel_helpers/applyDecoratedDescriptor/applyDecoratedDescriptor.js +0 -32
  22. package/dist/babel_helpers/applyDecs/applyDecs.js +0 -813
  23. package/dist/babel_helpers/applyDecs2203/applyDecs2203.js +0 -635
  24. package/dist/babel_helpers/applyDecs2203R/applyDecs2203R.js +0 -654
  25. package/dist/babel_helpers/applyDecs2301/applyDecs2301.js +0 -721
  26. package/dist/babel_helpers/applyDecs2305/applyDecs2305.js +0 -531
  27. package/dist/babel_helpers/arrayLikeToArray/arrayLikeToArray.js +0 -7
  28. package/dist/babel_helpers/arrayWithHoles/arrayWithHoles.js +0 -4
  29. package/dist/babel_helpers/arrayWithoutHoles/arrayWithoutHoles.js +0 -6
  30. package/dist/babel_helpers/assertThisInitialized/assertThisInitialized.js +0 -9
  31. package/dist/babel_helpers/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -55
  32. package/dist/babel_helpers/asyncIterator/asyncIterator.js +0 -68
  33. package/dist/babel_helpers/asyncToGenerator/asyncToGenerator.js +0 -34
  34. package/dist/babel_helpers/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -5
  35. package/dist/babel_helpers/callSuper/callSuper.js +0 -25
  36. package/dist/babel_helpers/checkInRHS/checkInRHS.js +0 -11
  37. package/dist/babel_helpers/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -23
  38. package/dist/babel_helpers/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -6
  39. package/dist/babel_helpers/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -13
  40. package/dist/babel_helpers/classCallCheck/classCallCheck.js +0 -5
  41. package/dist/babel_helpers/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -8
  42. package/dist/babel_helpers/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -11
  43. package/dist/babel_helpers/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -13
  44. package/dist/babel_helpers/classNameTDZError/classNameTDZError.js +0 -6
  45. package/dist/babel_helpers/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -7
  46. package/dist/babel_helpers/classPrivateFieldGet/classPrivateFieldGet.js +0 -7
  47. package/dist/babel_helpers/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -6
  48. package/dist/babel_helpers/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -5
  49. package/dist/babel_helpers/classPrivateFieldSet/classPrivateFieldSet.js +0 -8
  50. package/dist/babel_helpers/classPrivateMethodGet/classPrivateMethodGet.js +0 -6
  51. package/dist/babel_helpers/classPrivateMethodSet/classPrivateMethodSet.js +0 -3
  52. package/dist/babel_helpers/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -13
  53. package/dist/babel_helpers/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -15
  54. package/dist/babel_helpers/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -10
  55. package/dist/babel_helpers/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -3
  56. package/dist/babel_helpers/construct/construct.js +0 -20
  57. package/dist/babel_helpers/createClass/createClass.js +0 -17
  58. package/dist/babel_helpers/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -61
  59. package/dist/babel_helpers/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -24
  60. package/dist/babel_helpers/createRawReactElement/createRawReactElement.js +0 -50
  61. package/dist/babel_helpers/createSuper/createSuper.js +0 -22
  62. package/dist/babel_helpers/decorate/decorate.js +0 -488
  63. package/dist/babel_helpers/defaults/defaults.js +0 -11
  64. package/dist/babel_helpers/defineAccessor/defineAccessor.js +0 -6
  65. package/dist/babel_helpers/defineEnumerableProperties/defineEnumerableProperties.js +0 -23
  66. package/dist/babel_helpers/defineProperty/defineProperty.js +0 -21
  67. package/dist/babel_helpers/dispose/dispose.js +0 -45
  68. package/dist/babel_helpers/extends/extends.js +0 -14
  69. package/dist/babel_helpers/get/get.js +0 -19
  70. package/dist/babel_helpers/getPrototypeOf/getPrototypeOf.js +0 -4
  71. package/dist/babel_helpers/identity/identity.js +0 -3
  72. package/dist/babel_helpers/importDeferProxy/importDeferProxy.js +0 -31
  73. package/dist/babel_helpers/inherits/inherits.js +0 -19
  74. package/dist/babel_helpers/inheritsLoose/inheritsLoose.js +0 -7
  75. package/dist/babel_helpers/initializerDefineProperty/initializerDefineProperty.js +0 -12
  76. package/dist/babel_helpers/initializerWarningHelper/initializerWarningHelper.js +0 -6
  77. package/dist/babel_helpers/instanceof/instanceof.js +0 -10
  78. package/dist/babel_helpers/interopRequireDefault/interopRequireDefault.js +0 -3
  79. package/dist/babel_helpers/interopRequireWildcard/interopRequireWildcard.js +0 -47
  80. package/dist/babel_helpers/isNativeFunction/isNativeFunction.js +0 -9
  81. package/dist/babel_helpers/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -19
  82. package/dist/babel_helpers/iterableToArray/iterableToArray.js +0 -7
  83. package/dist/babel_helpers/iterableToArrayLimit/iterableToArrayLimit.js +0 -54
  84. package/dist/babel_helpers/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -16
  85. package/dist/babel_helpers/jsx/jsx.js +0 -50
  86. package/dist/babel_helpers/maybeArrayLike/maybeArrayLike.js +0 -10
  87. package/dist/babel_helpers/newArrowCheck/newArrowCheck.js +0 -5
  88. package/dist/babel_helpers/nonIterableRest/nonIterableRest.js +0 -5
  89. package/dist/babel_helpers/nonIterableSpread/nonIterableSpread.js +0 -5
  90. package/dist/babel_helpers/nullishReceiverError/nullishReceiverError.js +0 -3
  91. package/dist/babel_helpers/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -3
  92. package/dist/babel_helpers/objectSpread/objectSpread.js +0 -23
  93. package/dist/babel_helpers/objectSpread2/objectSpread2.js +0 -43
  94. package/dist/babel_helpers/objectWithoutProperties/objectWithoutProperties.js +0 -19
  95. package/dist/babel_helpers/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -13
  96. package/dist/babel_helpers/possibleConstructorReturn/possibleConstructorReturn.js +0 -12
  97. package/dist/babel_helpers/readOnlyError/readOnlyError.js +0 -4
  98. package/dist/babel_helpers/regeneratorRuntime/regeneratorRuntime.js +0 -698
  99. package/dist/babel_helpers/set/set.js +0 -47
  100. package/dist/babel_helpers/setFunctionName/setFunctionName.js +0 -19
  101. package/dist/babel_helpers/setPrototypeOf/setPrototypeOf.js +0 -7
  102. package/dist/babel_helpers/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -8
  103. package/dist/babel_helpers/slicedToArray/slicedToArray.js +0 -10
  104. package/dist/babel_helpers/slicedToArrayLoose/slicedToArrayLoose.js +0 -13
  105. package/dist/babel_helpers/superPropBase/superPropBase.js +0 -10
  106. package/dist/babel_helpers/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -10
  107. package/dist/babel_helpers/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -7
  108. package/dist/babel_helpers/tdz/tdz.js +0 -4
  109. package/dist/babel_helpers/temporalRef/temporalRef.js +0 -6
  110. package/dist/babel_helpers/temporalUndefined/temporalUndefined.js +0 -3
  111. package/dist/babel_helpers/toArray/toArray.js +0 -10
  112. package/dist/babel_helpers/toConsumableArray/toConsumableArray.js +0 -10
  113. package/dist/babel_helpers/toPrimitive/toPrimitive.js +0 -14
  114. package/dist/babel_helpers/toPropertyKey/toPropertyKey.js +0 -10
  115. package/dist/babel_helpers/typeof/typeof.js +0 -15
  116. package/dist/babel_helpers/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -12
  117. package/dist/babel_helpers/using/using.js +0 -23
  118. package/dist/babel_helpers/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -8
  119. package/dist/babel_helpers/wrapNativeSuper/wrapNativeSuper.js +0 -30
  120. package/dist/babel_helpers/wrapRegExp/wrapRegExp.js +0 -79
  121. package/dist/babel_helpers/writeOnlyError/writeOnlyError.js +0 -3
  122. package/dist/jsenv_core_node_modules.js +0 -2045
  123. package/dist/jsenv_core_packages.js +0 -23833
@@ -1,531 +0,0 @@
1
- /* @minVersion 7.21.0 */
2
- /* @mangleFns */
3
-
4
- import checkInRHS from "../checkInRHS/checkInRHS.js";
5
- import setFunctionName from "../setFunctionName/setFunctionName.js";
6
- import toPropertyKey from "../toPropertyKey/toPropertyKey.js";
7
-
8
- /**
9
- Basic usage:
10
-
11
- applyDecs(
12
- Class,
13
- [
14
- // member decorators
15
- [
16
- decs, // dec, or array of decs, or array of this values and decs
17
- 0, // kind of value being decorated
18
- 'prop', // name of public prop on class containing the value being decorated,
19
- '#p', // the name of the private property (if is private, void 0 otherwise),
20
- ]
21
- ],
22
- [
23
- // class decorators
24
- dec1, dec2
25
- ]
26
- )
27
- ```
28
-
29
- Fully transpiled example:
30
-
31
- ```js
32
- @dec
33
- class Class {
34
- @dec
35
- a = 123;
36
-
37
- @dec
38
- #a = 123;
39
-
40
- @dec
41
- @dec2
42
- accessor b = 123;
43
-
44
- @dec
45
- accessor #b = 123;
46
-
47
- @dec
48
- c() { console.log('c'); }
49
-
50
- @dec
51
- #c() { console.log('privC'); }
52
-
53
- @dec
54
- get d() { console.log('d'); }
55
-
56
- @dec
57
- get #d() { console.log('privD'); }
58
-
59
- @dec
60
- set e(v) { console.log('e'); }
61
-
62
- @dec
63
- set #e(v) { console.log('privE'); }
64
- }
65
-
66
-
67
- // becomes
68
- let initializeInstance;
69
- let initializeClass;
70
-
71
- let initA;
72
- let initPrivA;
73
-
74
- let initB;
75
- let initPrivB, getPrivB, setPrivB;
76
-
77
- let privC;
78
- let privD;
79
- let privE;
80
-
81
- let Class;
82
- class _Class {
83
- static {
84
- let ret = applyDecs(
85
- this,
86
- [
87
- [dec, 0, 'a'],
88
- [dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],
89
- [[dec, dec2], 1, 'b'],
90
- [dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],
91
- [dec, 2, 'c'],
92
- [dec, 2, 'c', () => console.log('privC')],
93
- [dec, 3, 'd'],
94
- [dec, 3, 'd', () => console.log('privD')],
95
- [dec, 4, 'e'],
96
- [dec, 4, 'e', () => console.log('privE')],
97
- ],
98
- [
99
- dec
100
- ]
101
- );
102
-
103
- initA = ret[0];
104
-
105
- initPrivA = ret[1];
106
-
107
- initB = ret[2];
108
-
109
- initPrivB = ret[3];
110
- getPrivB = ret[4];
111
- setPrivB = ret[5];
112
-
113
- privC = ret[6];
114
-
115
- privD = ret[7];
116
-
117
- privE = ret[8];
118
-
119
- initializeInstance = ret[9];
120
-
121
- Class = ret[10]
122
-
123
- initializeClass = ret[11];
124
- }
125
-
126
- a = (initializeInstance(this), initA(this, 123));
127
-
128
- #a = initPrivA(this, 123);
129
-
130
- #bData = initB(this, 123);
131
- get b() { return this.#bData }
132
- set b(v) { this.#bData = v }
133
-
134
- #privBData = initPrivB(this, 123);
135
- get #b() { return getPrivB(this); }
136
- set #b(v) { setPrivB(this, v); }
137
-
138
- c() { console.log('c'); }
139
-
140
- #c(...args) { return privC(this, ...args) }
141
-
142
- get d() { console.log('d'); }
143
-
144
- get #d() { return privD(this); }
145
-
146
- set e(v) { console.log('e'); }
147
-
148
- set #e(v) { privE(this, v); }
149
- }
150
-
151
- initializeClass(Class);
152
- */
153
-
154
- export default /* @no-mangle */ function applyDecs2305(
155
- targetClass,
156
- memberDecs,
157
- classDecs,
158
- classDecsHaveThis,
159
- instanceBrand,
160
- parentClass,
161
- ) {
162
- function _bindPropCall(obj, name, before) {
163
- return function (_this, value) {
164
- if (before) {
165
- before(_this);
166
- }
167
- return obj[name].call(_this, value);
168
- };
169
- }
170
-
171
- function runInitializers(initializers, value) {
172
- for (var i = 0; i < initializers.length; i++) {
173
- initializers[i].call(value);
174
- }
175
- return value;
176
- }
177
-
178
- function assertCallable(fn, hint1, hint2, throwUndefined) {
179
- if (typeof fn !== "function") {
180
- if (throwUndefined || fn !== void 0) {
181
- throw new TypeError(
182
- hint1 +
183
- " must " +
184
- (hint2 || "be") +
185
- " a function" +
186
- (throwUndefined ? "" : " or undefined"),
187
- );
188
- }
189
- }
190
- return fn;
191
- }
192
-
193
- /* @no-mangle */
194
- function applyDec(
195
- Class,
196
- decInfo,
197
- decoratorsHaveThis,
198
- name,
199
- kind,
200
- metadata,
201
- initializers,
202
- ret,
203
- isStatic,
204
- isPrivate,
205
- isField,
206
- isAccessor,
207
- hasPrivateBrand,
208
- ) {
209
- function assertInstanceIfPrivate(target) {
210
- if (!hasPrivateBrand(target)) {
211
- throw new TypeError(
212
- "Attempted to access private element on non-instance",
213
- );
214
- }
215
- }
216
-
217
- var decs = decInfo[0],
218
- decVal = decInfo[3],
219
- _,
220
- isClass = !ret;
221
-
222
- if (!isClass) {
223
- if (!decoratorsHaveThis && !Array.isArray(decs)) {
224
- decs = [decs];
225
- }
226
-
227
- var desc = {},
228
- init = [],
229
- key =
230
- kind === PROP_KIND.GETTER
231
- ? "get"
232
- : kind === PROP_KIND.SETTER || isAccessor
233
- ? "set"
234
- : "value";
235
-
236
- if (isPrivate) {
237
- if (isField || isAccessor) {
238
- desc = {
239
- get: setFunctionName(
240
- function (_this) {
241
- return decVal(_this);
242
- },
243
- name,
244
- "get",
245
- ),
246
- set: function (_this, value) {
247
- decInfo[4](_this, value);
248
- },
249
- };
250
- } else {
251
- desc[key] = decVal;
252
- }
253
-
254
- if (!isField) {
255
- setFunctionName(
256
- desc[key],
257
- name,
258
- kind === PROP_KIND.METHOD ? "" : key,
259
- );
260
- }
261
- } else if (!isField) {
262
- desc = Object.getOwnPropertyDescriptor(Class, name);
263
- }
264
- }
265
-
266
- var newValue = Class;
267
-
268
- for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
269
- var dec = decs[i],
270
- decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
271
-
272
- var decoratorFinishedRef = {};
273
- var ctx = {
274
- kind: ["field", "accessor", "method", "getter", "setter", "class"][
275
- kind
276
- ],
277
-
278
- name: name,
279
- metadata: metadata,
280
- addInitializer: function (decoratorFinishedRef, initializer) {
281
- if (decoratorFinishedRef.v) {
282
- throw new Error(
283
- "attempted to call addInitializer after decoration was finished",
284
- );
285
- }
286
- assertCallable(initializer, "An initializer", "be", true);
287
- initializers.push(initializer);
288
- }.bind(null, decoratorFinishedRef),
289
- };
290
-
291
- try {
292
- if (isClass) {
293
- if (
294
- (_ = assertCallable(
295
- dec.call(decThis, newValue, ctx),
296
- "class decorators",
297
- "return",
298
- ))
299
- ) {
300
- newValue = _;
301
- }
302
- } else {
303
- ctx.static = isStatic;
304
- ctx.private = isPrivate;
305
-
306
- var get, set;
307
- if (!isPrivate) {
308
- get = function (target) {
309
- return target[name];
310
- };
311
- if (kind < PROP_KIND.METHOD || kind === PROP_KIND.SETTER) {
312
- set = function (target, v) {
313
- target[name] = v;
314
- };
315
- }
316
- } else if (kind === PROP_KIND.METHOD) {
317
- get = function (_this) {
318
- assertInstanceIfPrivate(_this);
319
- return desc.value;
320
- };
321
- } else {
322
- if (kind < PROP_KIND.SETTER) {
323
- get = _bindPropCall(desc, "get", assertInstanceIfPrivate);
324
- }
325
- if (kind !== PROP_KIND.GETTER) {
326
- set = _bindPropCall(desc, "set", assertInstanceIfPrivate);
327
- }
328
- }
329
-
330
- var access = (ctx.access = {
331
- has: isPrivate
332
- ? // @ts-expect-error no thisArg
333
- hasPrivateBrand.bind()
334
- : function (target) {
335
- return name in target;
336
- },
337
- });
338
- if (get) access.get = get;
339
- if (set) access.set = set;
340
-
341
- newValue = dec.call(
342
- decThis,
343
- isAccessor
344
- ? {
345
- get: desc.get,
346
- set: desc.set,
347
- }
348
- : desc[key],
349
- ctx,
350
- );
351
-
352
- if (isAccessor) {
353
- if (typeof newValue === "object" && newValue) {
354
- if ((_ = assertCallable(newValue.get, "accessor.get"))) {
355
- desc.get = _;
356
- }
357
- if ((_ = assertCallable(newValue.set, "accessor.set"))) {
358
- desc.set = _;
359
- }
360
- if ((_ = assertCallable(newValue.init, "accessor.init"))) {
361
- init.push(_);
362
- }
363
- } else if (newValue !== void 0) {
364
- throw new TypeError(
365
- "accessor decorators must return an object with get, set, or init properties or void 0",
366
- );
367
- }
368
- } else if (
369
- assertCallable(
370
- newValue,
371
- (isField ? "field" : "method") + " decorators",
372
- "return",
373
- )
374
- ) {
375
- if (isField) {
376
- init.push(newValue);
377
- } else {
378
- desc[key] = newValue;
379
- }
380
- }
381
- }
382
- } finally {
383
- decoratorFinishedRef.v = true;
384
- }
385
- }
386
-
387
- if (isField || isAccessor) {
388
- ret.push(function (instance, value) {
389
- for (var i = init.length - 1; i >= 0; i--) {
390
- value = init[i].call(instance, value);
391
- }
392
- return value;
393
- });
394
- }
395
-
396
- if (!isField && !isClass) {
397
- if (isPrivate) {
398
- if (isAccessor) {
399
- ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set"));
400
- } else {
401
- ret.push(
402
- kind === PROP_KIND.METHOD
403
- ? desc[key]
404
- : _bindPropCall.call.bind(desc[key]),
405
- );
406
- }
407
- } else {
408
- Object.defineProperty(Class, name, desc);
409
- }
410
- }
411
- return newValue;
412
- }
413
-
414
- /* @no-mangle */
415
- function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
416
- var ret = [];
417
- var protoInitializers;
418
- var staticInitializers;
419
- var staticBrand = function (_) {
420
- return checkInRHS(_) === Class;
421
- };
422
-
423
- var existingNonFields = new Map();
424
-
425
- function pushInitializers(initializers) {
426
- if (initializers) {
427
- ret.push(runInitializers.bind(null, initializers));
428
- }
429
- }
430
-
431
- for (var i = 0; i < decInfos.length; i++) {
432
- var decInfo = decInfos[i];
433
-
434
- // skip computed property names
435
- if (!Array.isArray(decInfo)) continue;
436
-
437
- var kind = decInfo[1];
438
- var name = decInfo[2];
439
- var isPrivate = decInfo.length > 3;
440
-
441
- var decoratorsHaveThis = kind & PROP_KIND.DECORATORS_HAVE_THIS;
442
- var isStatic = !!(kind & PROP_KIND.STATIC);
443
-
444
- kind &= 7; /* 0b111 */
445
-
446
- var isField = kind === PROP_KIND.FIELD;
447
-
448
- var key = name + "/" + isStatic;
449
-
450
- if (!isField && !isPrivate) {
451
- var existingKind = existingNonFields.get(key);
452
-
453
- if (
454
- existingKind === true ||
455
- (existingKind === PROP_KIND.GETTER && kind !== PROP_KIND.SETTER) ||
456
- (existingKind === PROP_KIND.SETTER && kind !== PROP_KIND.GETTER)
457
- ) {
458
- throw new Error(
459
- "Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " +
460
- name,
461
- );
462
- }
463
- existingNonFields.set(key, kind > PROP_KIND.METHOD ? kind : true);
464
- }
465
-
466
- applyDec(
467
- isStatic ? Class : Class.prototype,
468
- decInfo,
469
- decoratorsHaveThis,
470
- isPrivate ? "#" + name : toPropertyKey(name),
471
- kind,
472
- metadata,
473
- isStatic
474
- ? (staticInitializers = staticInitializers || [])
475
- : (protoInitializers = protoInitializers || []),
476
- ret,
477
- isStatic,
478
- isPrivate,
479
- isField,
480
- kind === PROP_KIND.ACCESSOR,
481
- isStatic && isPrivate ? staticBrand : instanceBrand,
482
- );
483
- }
484
-
485
- pushInitializers(protoInitializers);
486
- pushInitializers(staticInitializers);
487
- return ret;
488
- }
489
-
490
- function defineMetadata(Class, metadata) {
491
- return Object.defineProperty(
492
- Class,
493
- Symbol.metadata || Symbol.for("Symbol.metadata"),
494
- { configurable: true, enumerable: true, value: metadata },
495
- );
496
- }
497
-
498
- if (arguments.length >= 6) {
499
- var parentMetadata =
500
- parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
501
- }
502
- var metadata = Object.create(parentMetadata == null ? null : parentMetadata);
503
- var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
504
- if (!classDecs.length) defineMetadata(targetClass, metadata);
505
- return {
506
- e: e,
507
- // Lazily apply class decorations so that member init locals can be properly bound.
508
- get c() {
509
- // The transformer will not emit assignment when there are no class decorators,
510
- // so we don't have to return an empty array here.
511
- var initializers = [];
512
- return (
513
- classDecs.length && [
514
- defineMetadata(
515
- applyDec(
516
- targetClass,
517
- [classDecs],
518
- classDecsHaveThis,
519
- targetClass.name,
520
- PROP_KIND.CLASS,
521
- metadata,
522
- initializers,
523
- ),
524
- metadata,
525
- ),
526
- runInitializers.bind(null, initializers, targetClass),
527
- ]
528
- );
529
- },
530
- };
531
- }
@@ -1,7 +0,0 @@
1
- /* eslint-disable no-eq-null, eqeqeq */
2
- export default function arrayLikeToArray(arr, len) {
3
- if (len == null || len > arr.length) len = arr.length;
4
- var arr2 = new Array(len);
5
- for (var i = 0; i < len; i++) arr2[i] = arr[i];
6
- return arr2;
7
- }
@@ -1,4 +0,0 @@
1
- // eslint-disable-next-line consistent-return
2
- export default (arr) => {
3
- if (Array.isArray(arr)) return arr;
4
- };
@@ -1,6 +0,0 @@
1
- import arrayLikeToArray from "../arrayLikeToArray/arrayLikeToArray.js";
2
-
3
- // eslint-disable-next-line consistent-return
4
- export default (arr) => {
5
- if (Array.isArray(arr)) return arrayLikeToArray(arr);
6
- };
@@ -1,9 +0,0 @@
1
- export default (self) => {
2
- // eslint-disable-next-line no-void
3
- if (self === void 0) {
4
- throw new ReferenceError(
5
- "this hasn't been initialised - super() hasn't been called",
6
- );
7
- }
8
- return self;
9
- };
@@ -1,55 +0,0 @@
1
- /* @minVersion 7.0.0-beta.0 */
2
-
3
- import OverloadYield from "../OverloadYield/OverloadYield.js";
4
-
5
- export default function _asyncGeneratorDelegate(inner) {
6
- var iter = {},
7
- // See the comment in AsyncGenerator to understand what this is.
8
- waiting = false;
9
-
10
- function pump(key, value) {
11
- waiting = true;
12
- value = new Promise(function (resolve) {
13
- resolve(inner[key](value));
14
- });
15
- return {
16
- done: false,
17
- value: new OverloadYield(value, /* kind: delegate */ 1),
18
- };
19
- }
20
-
21
- iter[(typeof Symbol !== "undefined" && Symbol.iterator) || "@@iterator"] =
22
- function () {
23
- return this;
24
- };
25
-
26
- iter.next = function (value) {
27
- if (waiting) {
28
- waiting = false;
29
- return value;
30
- }
31
- return pump("next", value);
32
- };
33
-
34
- if (typeof inner.throw === "function") {
35
- iter.throw = function (value) {
36
- if (waiting) {
37
- waiting = false;
38
- throw value;
39
- }
40
- return pump("throw", value);
41
- };
42
- }
43
-
44
- if (typeof inner.return === "function") {
45
- iter.return = function (value) {
46
- if (waiting) {
47
- waiting = false;
48
- return value;
49
- }
50
- return pump("return", value);
51
- };
52
- }
53
-
54
- return iter;
55
- }
@@ -1,68 +0,0 @@
1
- export default function _asyncIterator(iterable) {
2
- var method,
3
- async,
4
- sync,
5
- retry = 2;
6
-
7
- if (typeof Symbol !== "undefined") {
8
- async = Symbol.asyncIterator;
9
- sync = Symbol.iterator;
10
- }
11
-
12
- while (retry--) {
13
- if (async && (method = iterable[async]) != null) {
14
- return method.call(iterable);
15
- }
16
- if (sync && (method = iterable[sync]) != null) {
17
- return new AsyncFromSyncIterator(method.call(iterable));
18
- }
19
-
20
- async = "@@asyncIterator";
21
- sync = "@@iterator";
22
- }
23
-
24
- throw new TypeError("Object is not async iterable");
25
- }
26
-
27
- function AsyncFromSyncIterator(s) {
28
- AsyncFromSyncIterator = function (s) {
29
- this.s = s;
30
- this.n = s.next;
31
- };
32
- AsyncFromSyncIterator.prototype = {
33
- /* SyncIterator */ s: null,
34
- /* SyncIterator.[[Next]] */ n: null,
35
- next: function () {
36
- return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
37
- },
38
- return: function (value) {
39
- var ret = this.s.return;
40
- if (ret === undefined) {
41
- return Promise.resolve({ value: value, done: true });
42
- }
43
- return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
44
- },
45
- throw: function (value) {
46
- var thr = this.s.return;
47
- if (thr === undefined) {
48
- // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
49
- return Promise.reject(maybeError);
50
- }
51
- return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
52
- },
53
- };
54
-
55
- function AsyncFromSyncIteratorContinuation(r) {
56
- // This step is _before_ calling AsyncFromSyncIteratorContinuation in the spec.
57
- if (Object(r) !== r) {
58
- return Promise.reject(new TypeError(r + " is not an object."));
59
- }
60
-
61
- var done = r.done;
62
- return Promise.resolve(r.value).then(function (value) {
63
- return { value: value, done: done };
64
- });
65
- }
66
-
67
- return new AsyncFromSyncIterator(s);
68
- }