@jsenv/plugin-transpilation 1.3.3 → 1.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-transpilation",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "TODO",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,10 +31,10 @@
31
31
  "@babel/plugin-syntax-optional-catch-binding": "7.8.3",
32
32
  "@babel/plugin-transform-arrow-functions": "7.22.5",
33
33
  "@babel/plugin-transform-block-scoped-functions": "7.22.5",
34
- "@babel/plugin-transform-block-scoping": "7.22.15",
34
+ "@babel/plugin-transform-block-scoping": "7.23.0",
35
35
  "@babel/plugin-transform-classes": "7.22.15",
36
36
  "@babel/plugin-transform-computed-properties": "7.22.5",
37
- "@babel/plugin-transform-destructuring": "7.22.15",
37
+ "@babel/plugin-transform-destructuring": "7.23.0",
38
38
  "@babel/plugin-transform-dotall-regex": "7.22.5",
39
39
  "@babel/plugin-transform-duplicate-keys": "7.22.5",
40
40
  "@babel/plugin-transform-exponentiation-operator": "7.22.5",
@@ -53,9 +53,9 @@
53
53
  "@babel/plugin-transform-unicode-regex": "7.22.5",
54
54
  "babel-plugin-transform-async-to-promises": "0.8.18",
55
55
  "construct-style-sheets-polyfill": "3.1.0",
56
- "@jsenv/ast": "5.1.3",
56
+ "@jsenv/ast": "5.1.4",
57
57
  "@jsenv/runtime-compat": "1.2.0",
58
- "@jsenv/js-module-fallback": "1.3.4",
59
- "lightningcss": "1.21.8"
58
+ "@jsenv/js-module-fallback": "1.3.5",
59
+ "lightningcss": "1.22.0"
60
60
  }
61
61
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Babel helpers are copied in there to properly appear in sourcemap.
4
4
 
5
- - Last sync date: 11 September 2023
5
+ - Last sync date: 29 September 2023
6
6
 
7
7
  - Helpers file: https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers.ts
8
8
  - Individual helpers: https://github.com/babel/babel/tree/main/packages/babel-helpers/src/helpers
@@ -45,7 +45,8 @@ function memberDec(
45
45
  isStatic,
46
46
  isPrivate,
47
47
  value,
48
- hasPrivateBrand
48
+ hasPrivateBrand,
49
+ metadata
49
50
  ) {
50
51
  var kindStr;
51
52
 
@@ -71,6 +72,7 @@ function memberDec(
71
72
  name: isPrivate ? "#" + name : name,
72
73
  static: isStatic,
73
74
  private: isPrivate,
75
+ metadata: metadata,
74
76
  };
75
77
 
76
78
  var decoratorFinishedRef = { v: false };
@@ -211,7 +213,8 @@ function applyMemberDec(
211
213
  isStatic,
212
214
  isPrivate,
213
215
  initializers,
214
- hasPrivateBrand
216
+ hasPrivateBrand,
217
+ metadata
215
218
  ) {
216
219
  var decs = decInfo[0];
217
220
 
@@ -276,7 +279,8 @@ function applyMemberDec(
276
279
  isStatic,
277
280
  isPrivate,
278
281
  value,
279
- hasPrivateBrand
282
+ hasPrivateBrand,
283
+ metadata
280
284
  );
281
285
 
282
286
  if (newValue !== void 0) {
@@ -369,7 +373,7 @@ function applyMemberDec(
369
373
  }
370
374
  }
371
375
 
372
- function applyMemberDecs(Class, decInfos, instanceBrand) {
376
+ function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
373
377
  var ret = [];
374
378
  var protoInitializers;
375
379
  var staticInitializers;
@@ -451,7 +455,8 @@ function applyMemberDecs(Class, decInfos, instanceBrand) {
451
455
  isStatic,
452
456
  isPrivate,
453
457
  initializers,
454
- hasPrivateBrand
458
+ hasPrivateBrand,
459
+ metadata
455
460
  );
456
461
  }
457
462
 
@@ -471,7 +476,7 @@ function pushInitializers(ret, initializers) {
471
476
  }
472
477
  }
473
478
 
474
- function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
479
+ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis, metadata) {
475
480
  if (classDecs.length) {
476
481
  var initializers = [];
477
482
  var newClass = targetClass;
@@ -493,6 +498,7 @@ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
493
498
  initializers,
494
499
  decoratorFinishedRef
495
500
  ),
501
+ metadata,
496
502
  }
497
503
  );
498
504
  } finally {
@@ -506,7 +512,7 @@ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
506
512
  }
507
513
 
508
514
  return [
509
- newClass,
515
+ defineMetadata(newClass, metadata),
510
516
  function () {
511
517
  for (var i = 0; i < initializers.length; i++) {
512
518
  initializers[i].call(newClass);
@@ -518,6 +524,14 @@ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
518
524
  // so we don't have to return an empty array here.
519
525
  }
520
526
 
527
+ function defineMetadata(Class, metadata) {
528
+ return Object.defineProperty(
529
+ Class,
530
+ Symbol.metadata || Symbol.for("Symbol.metadata"),
531
+ { configurable: true, enumerable: true, value: metadata }
532
+ );
533
+ }
534
+
521
535
  /**
522
536
  Basic usage:
523
537
 
@@ -669,13 +683,28 @@ export default function applyDecs2305(
669
683
  memberDecs,
670
684
  classDecs,
671
685
  classDecsHaveThis,
672
- instanceBrand
686
+ instanceBrand,
687
+ parentClass
673
688
  ) {
689
+ if (arguments.length >= 6) {
690
+ var parentMetadata =
691
+ parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
692
+ }
693
+ var metadata = Object.create(
694
+ parentMetadata === void 0 ? null : parentMetadata
695
+ );
696
+ var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
697
+ if (!classDecs.length) defineMetadata(targetClass, metadata);
674
698
  return {
675
- e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
699
+ e: e,
676
700
  // Lazily apply class decorations so that member init locals can be properly bound.
677
701
  get c() {
678
- return applyClassDecs(targetClass, classDecs, classDecsHaveThis);
702
+ return applyClassDecs(
703
+ targetClass,
704
+ classDecs,
705
+ classDecsHaveThis,
706
+ metadata
707
+ );
679
708
  },
680
709
  };
681
710
  }
@@ -0,0 +1,31 @@
1
+ /* @minVersion 7.23.0 */
2
+ export default function _importDeferProxy(init) {
3
+ var ns = null;
4
+ var constValue = function (v) {
5
+ return function () {
6
+ return v;
7
+ };
8
+ };
9
+ var proxy = function (run) {
10
+ return function (arg1, arg2, arg3) {
11
+ if (ns === null) ns = init();
12
+ return run(ns, arg2, arg3);
13
+ };
14
+ };
15
+ return new Proxy(
16
+ {},
17
+ {
18
+ defineProperty: constValue(false),
19
+ deleteProperty: constValue(false),
20
+ get: proxy(Reflect.get),
21
+ getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor),
22
+ getPrototypeOf: constValue(null),
23
+ isExtensible: constValue(false),
24
+ has: proxy(Reflect.has),
25
+ ownKeys: proxy(Reflect.ownKeys),
26
+ preventExtensions: constValue(true),
27
+ set: constValue(false),
28
+ setPrototypeOf: constValue(false),
29
+ }
30
+ );
31
+ }
@@ -0,0 +1,3 @@
1
+ export function _nullishReceiverError() {
2
+ throw new TypeError("Cannot set property of null or undefined.");
3
+ }