@jsenv/core 36.2.1 → 36.3.1

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 (124) hide show
  1. package/dist/babel_helpers/AsyncGenerator/AsyncGenerator.js +45 -35
  2. package/dist/babel_helpers/AwaitValue/AwaitValue.js +3 -3
  3. package/dist/babel_helpers/applyDecoratedDescriptor/applyDecoratedDescriptor.js +13 -13
  4. package/dist/babel_helpers/applyDecs/applyDecs.js +227 -42
  5. package/dist/babel_helpers/applyDecs2203/applyDecs2203.js +559 -418
  6. package/dist/babel_helpers/applyDecs2203R/applyDecs2203R.js +235 -87
  7. package/dist/babel_helpers/applyDecs2301/applyDecs2301.js +591 -456
  8. package/dist/babel_helpers/applyDecs2305/applyDecs2305.js +681 -0
  9. package/dist/babel_helpers/arrayLikeToArray/arrayLikeToArray.js +5 -5
  10. package/dist/babel_helpers/arrayWithHoles/arrayWithHoles.js +3 -3
  11. package/dist/babel_helpers/arrayWithoutHoles/arrayWithoutHoles.js +4 -4
  12. package/dist/babel_helpers/assertThisInitialized/assertThisInitialized.js +4 -4
  13. package/dist/babel_helpers/asyncGeneratorDelegate/asyncGeneratorDelegate.js +12 -4
  14. package/dist/babel_helpers/asyncIterator/asyncIterator.js +13 -11
  15. package/dist/babel_helpers/asyncToGenerator/asyncToGenerator.js +18 -17
  16. package/dist/babel_helpers/awaitAsyncGenerator/awaitAsyncGenerator.js +2 -1
  17. package/dist/babel_helpers/checkInRHS/checkInRHS.js +8 -5
  18. package/dist/babel_helpers/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +7 -7
  19. package/dist/babel_helpers/classApplyDescriptorGet/classApplyDescriptorGet.js +3 -3
  20. package/dist/babel_helpers/classApplyDescriptorSet/classApplyDescriptorSet.js +4 -4
  21. package/dist/babel_helpers/classCallCheck/classCallCheck.js +2 -2
  22. package/dist/babel_helpers/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +2 -2
  23. package/dist/babel_helpers/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +2 -2
  24. package/dist/babel_helpers/classExtractFieldDescriptor/classExtractFieldDescriptor.js +3 -3
  25. package/dist/babel_helpers/classNameTDZError/classNameTDZError.js +2 -2
  26. package/dist/babel_helpers/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +6 -5
  27. package/dist/babel_helpers/classPrivateFieldGet/classPrivateFieldGet.js +6 -5
  28. package/dist/babel_helpers/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +3 -3
  29. package/dist/babel_helpers/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +3 -3
  30. package/dist/babel_helpers/classPrivateFieldSet/classPrivateFieldSet.js +7 -6
  31. package/dist/babel_helpers/classPrivateMethodGet/classPrivateMethodGet.js +3 -3
  32. package/dist/babel_helpers/classPrivateMethodSet/classPrivateMethodSet.js +2 -2
  33. package/dist/babel_helpers/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +8 -7
  34. package/dist/babel_helpers/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +15 -9
  35. package/dist/babel_helpers/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +5 -4
  36. package/dist/babel_helpers/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +2 -2
  37. package/dist/babel_helpers/construct/construct.js +10 -9
  38. package/dist/babel_helpers/createClass/createClass.js +2 -3
  39. package/dist/babel_helpers/createForOfIteratorHelper/createForOfIteratorHelper.js +30 -29
  40. package/dist/babel_helpers/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +18 -16
  41. package/dist/babel_helpers/createRawReactElement/createRawReactElement.js +23 -17
  42. package/dist/babel_helpers/createSuper/createSuper.js +14 -12
  43. package/dist/babel_helpers/decorate/decorate.js +242 -210
  44. package/dist/babel_helpers/defaults/defaults.js +6 -6
  45. package/dist/babel_helpers/defineAccessor/defineAccessor.js +1 -4
  46. package/dist/babel_helpers/defineEnumerableProperties/defineEnumerableProperties.js +12 -12
  47. package/dist/babel_helpers/defineProperty/defineProperty.js +7 -6
  48. package/dist/babel_helpers/extends/extends.js +5 -4
  49. package/dist/babel_helpers/get/get.js +2 -1
  50. package/dist/babel_helpers/getPrototypeOf/getPrototypeOf.js +4 -3
  51. package/dist/babel_helpers/inherits/inherits.js +3 -4
  52. package/dist/babel_helpers/inheritsLoose/inheritsLoose.js +6 -5
  53. package/dist/babel_helpers/initializerDefineProperty/initializerDefineProperty.js +4 -4
  54. package/dist/babel_helpers/initializerWarningHelper/initializerWarningHelper.js +5 -2
  55. package/dist/babel_helpers/instanceof/instanceof.js +3 -3
  56. package/dist/babel_helpers/interopRequireDefault/interopRequireDefault.js +2 -4
  57. package/dist/babel_helpers/interopRequireWildcard/interopRequireWildcard.js +19 -21
  58. package/dist/babel_helpers/isNativeFunction/isNativeFunction.js +2 -2
  59. package/dist/babel_helpers/isNativeReflectConstruct/isNativeReflectConstruct.js +7 -7
  60. package/dist/babel_helpers/iterableToArray/iterableToArray.js +6 -2
  61. package/dist/babel_helpers/iterableToArrayLimit/iterableToArrayLimit.js +6 -1
  62. package/dist/babel_helpers/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +6 -2
  63. package/dist/babel_helpers/jsx/jsx.js +14 -7
  64. package/dist/babel_helpers/maybeArrayLike/maybeArrayLike.js +6 -5
  65. package/dist/babel_helpers/newArrowCheck/newArrowCheck.js +2 -2
  66. package/dist/babel_helpers/nonIterableRest/nonIterableRest.js +5 -3
  67. package/dist/babel_helpers/nonIterableSpread/nonIterableSpread.js +5 -3
  68. package/dist/babel_helpers/objectDestructuringEmpty/objectDestructuringEmpty.js +2 -2
  69. package/dist/babel_helpers/objectSpread/objectSpread.js +15 -12
  70. package/dist/babel_helpers/objectSpread2/objectSpread2.js +7 -2
  71. package/dist/babel_helpers/objectWithoutProperties/objectWithoutProperties.js +15 -13
  72. package/dist/babel_helpers/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +11 -11
  73. package/dist/babel_helpers/possibleConstructorReturn/possibleConstructorReturn.js +7 -6
  74. package/dist/babel_helpers/readOnlyError/readOnlyError.js +2 -2
  75. package/dist/babel_helpers/regeneratorRuntime/regeneratorRuntime.js +124 -73
  76. package/dist/babel_helpers/set/set.js +23 -20
  77. package/dist/babel_helpers/setPrototypeOf/setPrototypeOf.js +6 -5
  78. package/dist/babel_helpers/skipFirstGeneratorNext/skipFirstGeneratorNext.js +5 -5
  79. package/dist/babel_helpers/slicedToArray/slicedToArray.js +10 -5
  80. package/dist/babel_helpers/slicedToArrayLoose/slicedToArrayLoose.js +12 -6
  81. package/dist/babel_helpers/superPropBase/superPropBase.js +6 -5
  82. package/dist/babel_helpers/taggedTemplateLiteral/taggedTemplateLiteral.js +7 -7
  83. package/dist/babel_helpers/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +4 -4
  84. package/dist/babel_helpers/tdz/tdz.js +2 -2
  85. package/dist/babel_helpers/temporalRef/temporalRef.js +5 -4
  86. package/dist/babel_helpers/temporalUndefined/temporalUndefined.js +1 -1
  87. package/dist/babel_helpers/toArray/toArray.js +10 -5
  88. package/dist/babel_helpers/toConsumableArray/toConsumableArray.js +10 -5
  89. package/dist/babel_helpers/toPrimitive/toPrimitive.js +7 -7
  90. package/dist/babel_helpers/toPropertyKey/toPropertyKey.js +5 -4
  91. package/dist/babel_helpers/typeof/typeof.js +14 -5
  92. package/dist/babel_helpers/unsupportedIterableToArray/unsupportedIterableToArray.js +10 -8
  93. package/dist/babel_helpers/wrapAsyncGenerator/wrapAsyncGenerator.js +5 -4
  94. package/dist/babel_helpers/wrapNativeSuper/wrapNativeSuper.js +17 -15
  95. package/dist/babel_helpers/wrapRegExp/wrapRegExp.js +19 -8
  96. package/dist/babel_helpers/writeOnlyError/writeOnlyError.js +2 -2
  97. package/dist/js/autoreload.js +148 -133
  98. package/dist/js/import_meta_hot.js +19 -13
  99. package/dist/js/inline_content.js +1 -3
  100. package/dist/js/new_stylesheet.js +119 -60
  101. package/dist/js/regenerator_runtime.js +204 -102
  102. package/dist/js/ribbon.js +11 -6
  103. package/dist/js/server_events_client.js +122 -98
  104. package/dist/js/ws.js +968 -265
  105. package/dist/jsenv_core.js +8513 -6162
  106. package/package.json +13 -12
  107. package/src/build/build.js +497 -486
  108. package/src/build/version_mappings_injection.js +21 -44
  109. package/src/kitchen/errors.js +2 -2
  110. package/src/kitchen/fetched_content_compliance.js +6 -2
  111. package/src/kitchen/kitchen.js +285 -80
  112. package/src/kitchen/prepend_content.js +135 -0
  113. package/src/kitchen/url_graph/url_graph_visitor.js +99 -0
  114. package/src/kitchen/url_graph/url_info_transformations.js +140 -21
  115. package/src/kitchen/url_graph.js +59 -29
  116. package/src/plugins/autoreload/jsenv_plugin_hmr.js +1 -2
  117. package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +2 -2
  118. package/src/plugins/importmap/jsenv_plugin_importmap.js +2 -2
  119. package/src/plugins/inlining/jsenv_plugin_inlining_as_data_url.js +1 -1
  120. package/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js +44 -23
  121. package/src/plugins/reference_analysis/js/jsenv_plugin_js_reference_analysis.js +2 -1
  122. package/dist/js/global_this_js_classic.js +0 -24
  123. package/dist/js/global_this_js_module.js +0 -20
  124. package/src/build/graph_utils.js +0 -34
@@ -26,8 +26,19 @@ function applyDecs2203RFactory() {
26
26
  initializers.push(initializer);
27
27
  };
28
28
  }
29
- function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
29
+
30
+ function memberDec(
31
+ dec,
32
+ name,
33
+ desc,
34
+ initializers,
35
+ kind,
36
+ isStatic,
37
+ isPrivate,
38
+ value
39
+ ) {
30
40
  var kindStr;
41
+
31
42
  switch (kind) {
32
43
  case 1 /* ACCESSOR */:
33
44
  kindStr = "accessor";
@@ -44,18 +55,23 @@ function applyDecs2203RFactory() {
44
55
  default:
45
56
  kindStr = "field";
46
57
  }
58
+
47
59
  var ctx = {
48
60
  kind: kindStr,
49
61
  name: isPrivate ? "#" + name : name,
50
62
  static: isStatic,
51
- private: isPrivate
52
- };
53
- var decoratorFinishedRef = {
54
- v: false
63
+ private: isPrivate,
55
64
  };
65
+
66
+ var decoratorFinishedRef = { v: false };
67
+
56
68
  if (kind !== 0 /* FIELD */) {
57
- ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
69
+ ctx.addInitializer = createAddInitializerMethod(
70
+ initializers,
71
+ decoratorFinishedRef
72
+ );
58
73
  }
74
+
59
75
  var get, set;
60
76
  if (kind === 0 /* FIELD */) {
61
77
  if (isPrivate) {
@@ -80,41 +96,45 @@ function applyDecs2203RFactory() {
80
96
  return desc.get.call(this);
81
97
  };
82
98
  }
99
+
83
100
  if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {
84
101
  set = function (v) {
85
102
  desc.set.call(this, v);
86
103
  };
87
104
  }
88
105
  }
89
- ctx.access = get && set ? {
90
- get: get,
91
- set: set
92
- } : get ? {
93
- get: get
94
- } : {
95
- set: set
96
- };
106
+ ctx.access =
107
+ get && set ? { get: get, set: set } : get ? { get: get } : { set: set };
108
+
97
109
  try {
98
110
  return dec(value, ctx);
99
111
  } finally {
100
112
  decoratorFinishedRef.v = true;
101
113
  }
102
114
  }
115
+
103
116
  function assertNotFinished(decoratorFinishedRef, fnName) {
104
117
  if (decoratorFinishedRef.v) {
105
- throw new Error("attempted to call " + fnName + " after decoration was finished");
118
+ throw new Error(
119
+ "attempted to call " + fnName + " after decoration was finished"
120
+ );
106
121
  }
107
122
  }
123
+
108
124
  function assertCallable(fn, hint) {
109
125
  if (typeof fn !== "function") {
110
126
  throw new TypeError(hint + " must be a function");
111
127
  }
112
128
  }
129
+
113
130
  function assertValidReturnValue(kind, value) {
114
131
  var type = typeof value;
132
+
115
133
  if (kind === 1 /* ACCESSOR */) {
116
134
  if (type !== "object" || value === null) {
117
- throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
135
+ throw new TypeError(
136
+ "accessor decorators must return an object with get, set, or init properties or void 0"
137
+ );
118
138
  }
119
139
  if (value.get !== undefined) {
120
140
  assertCallable(value.get, "accessor.get");
@@ -134,38 +154,53 @@ function applyDecs2203RFactory() {
134
154
  } else {
135
155
  hint = "method";
136
156
  }
137
- throw new TypeError(hint + " decorators must return a function or void 0");
157
+ throw new TypeError(
158
+ hint + " decorators must return a function or void 0"
159
+ );
138
160
  }
139
161
  }
140
- function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
162
+
163
+ function applyMemberDec(
164
+ ret,
165
+ base,
166
+ decInfo,
167
+ name,
168
+ kind,
169
+ isStatic,
170
+ isPrivate,
171
+ initializers
172
+ ) {
141
173
  var decs = decInfo[0];
174
+
142
175
  var desc, init, value;
176
+
143
177
  if (isPrivate) {
144
178
  if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
145
179
  desc = {
146
180
  get: decInfo[3],
147
- set: decInfo[4]
181
+ set: decInfo[4],
148
182
  };
149
183
  } else if (kind === 3 /* GETTER */) {
150
184
  desc = {
151
- get: decInfo[3]
185
+ get: decInfo[3],
152
186
  };
153
187
  } else if (kind === 4 /* SETTER */) {
154
188
  desc = {
155
- set: decInfo[3]
189
+ set: decInfo[3],
156
190
  };
157
191
  } else {
158
192
  desc = {
159
- value: decInfo[3]
193
+ value: decInfo[3],
160
194
  };
161
195
  }
162
196
  } else if (kind !== 0 /* FIELD */) {
163
197
  desc = Object.getOwnPropertyDescriptor(base, name);
164
198
  }
199
+
165
200
  if (kind === 1 /* ACCESSOR */) {
166
201
  value = {
167
202
  get: desc.get,
168
- set: desc.set
203
+ set: desc.set,
169
204
  };
170
205
  } else if (kind === 2 /* METHOD */) {
171
206
  value = desc.value;
@@ -174,21 +209,32 @@ function applyDecs2203RFactory() {
174
209
  } else if (kind === 4 /* SETTER */) {
175
210
  value = desc.set;
176
211
  }
212
+
177
213
  var newValue, get, set;
214
+
178
215
  if (typeof decs === "function") {
179
- newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value);
216
+ newValue = memberDec(
217
+ decs,
218
+ name,
219
+ desc,
220
+ initializers,
221
+ kind,
222
+ isStatic,
223
+ isPrivate,
224
+ value
225
+ );
226
+
180
227
  if (newValue !== void 0) {
181
228
  assertValidReturnValue(kind, newValue);
229
+
182
230
  if (kind === 0 /* FIELD */) {
183
231
  init = newValue;
184
232
  } else if (kind === 1 /* ACCESSOR */) {
185
233
  init = newValue.init;
186
234
  get = newValue.get || value.get;
187
235
  set = newValue.set || value.set;
188
- value = {
189
- get: get,
190
- set: set
191
- };
236
+
237
+ value = { get: get, set: set };
192
238
  } else {
193
239
  value = newValue;
194
240
  }
@@ -196,23 +242,34 @@ function applyDecs2203RFactory() {
196
242
  } else {
197
243
  for (var i = decs.length - 1; i >= 0; i--) {
198
244
  var dec = decs[i];
199
- newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value);
245
+
246
+ newValue = memberDec(
247
+ dec,
248
+ name,
249
+ desc,
250
+ initializers,
251
+ kind,
252
+ isStatic,
253
+ isPrivate,
254
+ value
255
+ );
256
+
200
257
  if (newValue !== void 0) {
201
258
  assertValidReturnValue(kind, newValue);
202
259
  var newInit;
260
+
203
261
  if (kind === 0 /* FIELD */) {
204
262
  newInit = newValue;
205
263
  } else if (kind === 1 /* ACCESSOR */) {
206
264
  newInit = newValue.init;
207
265
  get = newValue.get || value.get;
208
266
  set = newValue.set || value.set;
209
- value = {
210
- get: get,
211
- set: set
212
- };
267
+
268
+ value = { get: get, set: set };
213
269
  } else {
214
270
  value = newValue;
215
271
  }
272
+
216
273
  if (newInit !== void 0) {
217
274
  if (init === void 0) {
218
275
  init = newInit;
@@ -225,6 +282,7 @@ function applyDecs2203RFactory() {
225
282
  }
226
283
  }
227
284
  }
285
+
228
286
  if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
229
287
  if (init === void 0) {
230
288
  // If the initializer was void 0, sub in a dummy initializer
@@ -233,21 +291,27 @@ function applyDecs2203RFactory() {
233
291
  };
234
292
  } else if (typeof init !== "function") {
235
293
  var ownInitializers = init;
294
+
236
295
  init = function (instance, init) {
237
296
  var value = init;
297
+
238
298
  for (var i = 0; i < ownInitializers.length; i++) {
239
299
  value = ownInitializers[i].call(instance, value);
240
300
  }
301
+
241
302
  return value;
242
303
  };
243
304
  } else {
244
305
  var originalInitializer = init;
306
+
245
307
  init = function (instance, init) {
246
308
  return originalInitializer.call(instance, init);
247
309
  };
248
310
  }
311
+
249
312
  ret.push(init);
250
313
  }
314
+
251
315
  if (kind !== 0 /* FIELD */) {
252
316
  if (kind === 1 /* ACCESSOR */) {
253
317
  desc.get = value.get;
@@ -259,6 +323,7 @@ function applyDecs2203RFactory() {
259
323
  } else if (kind === 4 /* SETTER */) {
260
324
  desc.set = value;
261
325
  }
326
+
262
327
  if (isPrivate) {
263
328
  if (kind === 1 /* ACCESSOR */) {
264
329
  ret.push(function (instance, args) {
@@ -279,23 +344,29 @@ function applyDecs2203RFactory() {
279
344
  }
280
345
  }
281
346
  }
347
+
282
348
  function applyMemberDecs(Class, decInfos) {
283
349
  var ret = [];
284
350
  var protoInitializers;
285
351
  var staticInitializers;
352
+
286
353
  var existingProtoNonFields = new Map();
287
354
  var existingStaticNonFields = new Map();
355
+
288
356
  for (var i = 0; i < decInfos.length; i++) {
289
357
  var decInfo = decInfos[i];
290
358
 
291
359
  // skip computed property names
292
360
  if (!Array.isArray(decInfo)) continue;
361
+
293
362
  var kind = decInfo[1];
294
363
  var name = decInfo[2];
295
364
  var isPrivate = decInfo.length > 3;
365
+
296
366
  var isStatic = kind >= 5; /* STATIC */
297
367
  var base;
298
368
  var initializers;
369
+
299
370
  if (isStatic) {
300
371
  base = Class;
301
372
  kind = kind - 5 /* STATIC */;
@@ -312,23 +383,47 @@ function applyDecs2203RFactory() {
312
383
  initializers = protoInitializers;
313
384
  }
314
385
  }
386
+
315
387
  if (kind !== 0 /* FIELD */ && !isPrivate) {
316
- var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
388
+ var existingNonFields = isStatic
389
+ ? existingStaticNonFields
390
+ : existingProtoNonFields;
391
+
317
392
  var existingKind = existingNonFields.get(name) || 0;
318
- if (existingKind === true || existingKind === 3 /* GETTER */ && kind !== 4 /* SETTER */ || existingKind === 4 /* SETTER */ && kind !== 3 /* GETTER */) {
319
- throw new Error("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: " + name);
393
+
394
+ if (
395
+ existingKind === true ||
396
+ (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ ||
397
+ (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */
398
+ ) {
399
+ throw new Error(
400
+ "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: " +
401
+ name
402
+ );
320
403
  } else if (!existingKind && kind > 2 /* METHOD */) {
321
404
  existingNonFields.set(name, kind);
322
405
  } else {
323
406
  existingNonFields.set(name, true);
324
407
  }
325
408
  }
326
- applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
409
+
410
+ applyMemberDec(
411
+ ret,
412
+ base,
413
+ decInfo,
414
+ name,
415
+ kind,
416
+ isStatic,
417
+ isPrivate,
418
+ initializers
419
+ );
327
420
  }
421
+
328
422
  pushInitializers(ret, protoInitializers);
329
423
  pushInitializers(ret, staticInitializers);
330
424
  return ret;
331
425
  }
426
+
332
427
  function pushInitializers(ret, initializers) {
333
428
  if (initializers) {
334
429
  ret.push(function (instance) {
@@ -339,34 +434,43 @@ function applyDecs2203RFactory() {
339
434
  });
340
435
  }
341
436
  }
437
+
342
438
  function applyClassDecs(targetClass, classDecs) {
343
439
  if (classDecs.length > 0) {
344
440
  var initializers = [];
345
441
  var newClass = targetClass;
346
442
  var name = targetClass.name;
443
+
347
444
  for (var i = classDecs.length - 1; i >= 0; i--) {
348
- var decoratorFinishedRef = {
349
- v: false
350
- };
445
+ var decoratorFinishedRef = { v: false };
446
+
351
447
  try {
352
448
  var nextNewClass = classDecs[i](newClass, {
353
449
  kind: "class",
354
450
  name: name,
355
- addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
451
+ addInitializer: createAddInitializerMethod(
452
+ initializers,
453
+ decoratorFinishedRef
454
+ ),
356
455
  });
357
456
  } finally {
358
457
  decoratorFinishedRef.v = true;
359
458
  }
459
+
360
460
  if (nextNewClass !== undefined) {
361
461
  assertValidReturnValue(10 /* CLASS */, nextNewClass);
362
462
  newClass = nextNewClass;
363
463
  }
364
464
  }
365
- return [newClass, function () {
366
- for (var i = 0; i < initializers.length; i++) {
367
- initializers[i].call(newClass);
368
- }
369
- }];
465
+
466
+ return [
467
+ newClass,
468
+ function () {
469
+ for (var i = 0; i < initializers.length; i++) {
470
+ initializers[i].call(newClass);
471
+ }
472
+ },
473
+ ];
370
474
  }
371
475
  // The transformer will not emit assignment when there are no class decorators,
372
476
  // so we don't have to return an empty array here.
@@ -374,7 +478,8 @@ function applyDecs2203RFactory() {
374
478
 
375
479
  /**
376
480
  Basic usage:
377
- applyDecs(
481
+
482
+ applyDecs(
378
483
  Class,
379
484
  [
380
485
  // member decorators
@@ -391,43 +496,60 @@ function applyDecs2203RFactory() {
391
496
  ]
392
497
  )
393
498
  ```
394
- Fully transpiled example:
395
- ```js
499
+
500
+ Fully transpiled example:
501
+
502
+ ```js
396
503
  @dec
397
504
  class Class {
398
505
  @dec
399
506
  a = 123;
400
- @dec
507
+
508
+ @dec
401
509
  #a = 123;
402
- @dec
510
+
511
+ @dec
403
512
  @dec2
404
513
  accessor b = 123;
405
- @dec
514
+
515
+ @dec
406
516
  accessor #b = 123;
407
- @dec
517
+
518
+ @dec
408
519
  c() { console.log('c'); }
409
- @dec
520
+
521
+ @dec
410
522
  #c() { console.log('privC'); }
411
- @dec
523
+
524
+ @dec
412
525
  get d() { console.log('d'); }
413
- @dec
526
+
527
+ @dec
414
528
  get #d() { console.log('privD'); }
415
- @dec
529
+
530
+ @dec
416
531
  set e(v) { console.log('e'); }
417
- @dec
532
+
533
+ @dec
418
534
  set #e(v) { console.log('privE'); }
419
535
  }
420
- // becomes
536
+
537
+
538
+ // becomes
421
539
  let initializeInstance;
422
540
  let initializeClass;
423
- let initA;
541
+
542
+ let initA;
424
543
  let initPrivA;
425
- let initB;
544
+
545
+ let initB;
426
546
  let initPrivB, getPrivB, setPrivB;
427
- let privC;
547
+
548
+ let privC;
428
549
  let privD;
429
550
  let privE;
430
- let Class;
551
+
552
+ let Class;
431
553
  class _Class {
432
554
  static {
433
555
  let ret = applyDecs(
@@ -448,36 +570,57 @@ function applyDecs2203RFactory() {
448
570
  dec
449
571
  ]
450
572
  )
451
- initA = ret[0];
452
- initPrivA = ret[1];
453
- initB = ret[2];
454
- initPrivB = ret[3];
573
+
574
+ initA = ret[0];
575
+
576
+ initPrivA = ret[1];
577
+
578
+ initB = ret[2];
579
+
580
+ initPrivB = ret[3];
455
581
  getPrivB = ret[4];
456
582
  setPrivB = ret[5];
457
- privC = ret[6];
458
- privD = ret[7];
459
- privE = ret[8];
460
- initializeInstance = ret[9];
461
- Class = ret[10]
462
- initializeClass = ret[11];
583
+
584
+ privC = ret[6];
585
+
586
+ privD = ret[7];
587
+
588
+ privE = ret[8];
589
+
590
+ initializeInstance = ret[9];
591
+
592
+ Class = ret[10]
593
+
594
+ initializeClass = ret[11];
463
595
  }
464
- a = (initializeInstance(this), initA(this, 123));
465
- #a = initPrivA(this, 123);
466
- #bData = initB(this, 123);
596
+
597
+ a = (initializeInstance(this), initA(this, 123));
598
+
599
+ #a = initPrivA(this, 123);
600
+
601
+ #bData = initB(this, 123);
467
602
  get b() { return this.#bData }
468
603
  set b(v) { this.#bData = v }
469
- #privBData = initPrivB(this, 123);
604
+
605
+ #privBData = initPrivB(this, 123);
470
606
  get #b() { return getPrivB(this); }
471
607
  set #b(v) { setPrivB(this, v); }
472
- c() { console.log('c'); }
473
- #c(...args) { return privC(this, ...args) }
474
- get d() { console.log('d'); }
475
- get #d() { return privD(this); }
476
- set e(v) { console.log('e'); }
477
- set #e(v) { privE(this, v); }
608
+
609
+ c() { console.log('c'); }
610
+
611
+ #c(...args) { return privC(this, ...args) }
612
+
613
+ get d() { console.log('d'); }
614
+
615
+ get #d() { return privD(this); }
616
+
617
+ set e(v) { console.log('e'); }
618
+
619
+ set #e(v) { privE(this, v); }
478
620
  }
479
- initializeClass(Class);
480
- */
621
+
622
+ initializeClass(Class);
623
+ */
481
624
 
482
625
  return function applyDecs2203R(targetClass, memberDecs, classDecs) {
483
626
  return {
@@ -485,10 +628,15 @@ function applyDecs2203RFactory() {
485
628
  // Lazily apply class decorations so that member init locals can be properly bound.
486
629
  get c() {
487
630
  return applyClassDecs(targetClass, classDecs);
488
- }
631
+ },
489
632
  };
490
633
  };
491
634
  }
635
+
492
636
  export default function applyDecs2203R(targetClass, memberDecs, classDecs) {
493
- return (applyDecs2203R = applyDecs2203RFactory())(targetClass, memberDecs, classDecs);
637
+ return (applyDecs2203R = applyDecs2203RFactory())(
638
+ targetClass,
639
+ memberDecs,
640
+ classDecs
641
+ );
494
642
  }