@jsenv/plugin-transpilation 1.3.1 → 1.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.
- package/package.json +10 -10
- package/src/babel/babel_helper_directory/README.md +1 -1
- package/src/babel/babel_helper_directory/babel_helpers/dispose/dispose.js +45 -0
- package/src/babel/babel_helper_directory/babel_helpers/regeneratorRuntime/regeneratorRuntime.js +2 -6
- package/src/babel/babel_helper_directory/babel_helpers/using/using.js +23 -0
- package/src/js_module_fallback/jsenv_plugin_js_module_fallback_on_workers.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/plugin-transpilation",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,20 +31,20 @@
|
|
|
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.
|
|
35
|
-
"@babel/plugin-transform-classes": "7.22.
|
|
34
|
+
"@babel/plugin-transform-block-scoping": "7.22.15",
|
|
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.
|
|
37
|
+
"@babel/plugin-transform-destructuring": "7.22.15",
|
|
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",
|
|
41
|
-
"@babel/plugin-transform-for-of": "7.22.
|
|
41
|
+
"@babel/plugin-transform-for-of": "7.22.15",
|
|
42
42
|
"@babel/plugin-transform-function-name": "7.22.5",
|
|
43
43
|
"@babel/plugin-transform-literals": "7.22.5",
|
|
44
44
|
"@babel/plugin-transform-new-target": "7.22.5",
|
|
45
45
|
"@babel/plugin-transform-object-super": "7.22.5",
|
|
46
|
-
"@babel/plugin-transform-parameters": "7.22.
|
|
47
|
-
"@babel/plugin-transform-regenerator": "7.22.
|
|
46
|
+
"@babel/plugin-transform-parameters": "7.22.15",
|
|
47
|
+
"@babel/plugin-transform-regenerator": "7.22.10",
|
|
48
48
|
"@babel/plugin-transform-shorthand-properties": "7.22.5",
|
|
49
49
|
"@babel/plugin-transform-spread": "7.22.5",
|
|
50
50
|
"@babel/plugin-transform-sticky-regex": "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.
|
|
56
|
+
"@jsenv/ast": "5.1.3",
|
|
57
57
|
"@jsenv/runtime-compat": "1.2.0",
|
|
58
|
-
"@jsenv/js-module-fallback": "1.3.
|
|
59
|
-
"lightningcss": "1.21.
|
|
58
|
+
"@jsenv/js-module-fallback": "1.3.4",
|
|
59
|
+
"lightningcss": "1.21.8"
|
|
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:
|
|
5
|
+
- Last sync date: 11 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
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* @minVersion 7.22.0 */
|
|
2
|
+
function dispose_SuppressedError(suppressed, error) {
|
|
3
|
+
if (typeof SuppressedError !== "undefined") {
|
|
4
|
+
// eslint-disable-next-line no-undef
|
|
5
|
+
dispose_SuppressedError = SuppressedError;
|
|
6
|
+
} else {
|
|
7
|
+
dispose_SuppressedError = function SuppressedError(suppressed, error) {
|
|
8
|
+
this.suppressed = suppressed;
|
|
9
|
+
this.error = error;
|
|
10
|
+
this.stack = new Error().stack;
|
|
11
|
+
};
|
|
12
|
+
dispose_SuppressedError.prototype = Object.create(Error.prototype, {
|
|
13
|
+
constructor: {
|
|
14
|
+
value: dispose_SuppressedError,
|
|
15
|
+
writable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return new dispose_SuppressedError(suppressed, error);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function _dispose(stack, error, hasError) {
|
|
24
|
+
function next() {
|
|
25
|
+
while (stack.length > 0) {
|
|
26
|
+
try {
|
|
27
|
+
var r = stack.pop();
|
|
28
|
+
var p = r.d.call(r.v);
|
|
29
|
+
if (r.a) return Promise.resolve(p).then(next, err);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
return err(e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (hasError) throw error;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function err(e) {
|
|
38
|
+
error = hasError ? new dispose_SuppressedError(e, error) : e;
|
|
39
|
+
hasError = true;
|
|
40
|
+
|
|
41
|
+
return next();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return next();
|
|
45
|
+
}
|
package/src/babel/babel_helper_directory/babel_helpers/regeneratorRuntime/regeneratorRuntime.js
CHANGED
|
@@ -483,7 +483,7 @@ export default function _regeneratorRuntime() {
|
|
|
483
483
|
};
|
|
484
484
|
};
|
|
485
485
|
function values(iterable) {
|
|
486
|
-
if (iterable) {
|
|
486
|
+
if (iterable || iterable === "") {
|
|
487
487
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
488
488
|
if (iteratorMethod) {
|
|
489
489
|
return iteratorMethod.call(iterable);
|
|
@@ -508,11 +508,7 @@ export default function _regeneratorRuntime() {
|
|
|
508
508
|
return (next.next = next);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
|
|
512
|
-
// Return an iterator with no values.
|
|
513
|
-
return {
|
|
514
|
-
next: doneResult,
|
|
515
|
-
};
|
|
511
|
+
throw new TypeError(typeof iterable + " is not iterable");
|
|
516
512
|
}
|
|
517
513
|
exports.values = values;
|
|
518
514
|
function doneResult() {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* @minVersion 7.22.0 */
|
|
2
|
+
|
|
3
|
+
export default function _using(stack, value, isAwait) {
|
|
4
|
+
if (value === null || value === void 0) return value;
|
|
5
|
+
if (typeof value !== "object") {
|
|
6
|
+
throw new TypeError(
|
|
7
|
+
"using declarations can only be used with objects, null, or undefined."
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
// core-js-pure uses Symbol.for for polyfilling well-known symbols
|
|
11
|
+
if (isAwait) {
|
|
12
|
+
var dispose =
|
|
13
|
+
value[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
|
|
14
|
+
}
|
|
15
|
+
if (dispose === null || dispose === void 0) {
|
|
16
|
+
dispose = value[Symbol.dispose || Symbol.for("Symbol.dispose")];
|
|
17
|
+
}
|
|
18
|
+
if (typeof dispose !== "function") {
|
|
19
|
+
throw new TypeError(`Property [Symbol.dispose] is not a function.`);
|
|
20
|
+
}
|
|
21
|
+
stack.push({ v: value, d: dispose, a: isAwait });
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
@@ -31,9 +31,13 @@ export const jsenvPluginJsModuleFallbackOnWorkers = () => {
|
|
|
31
31
|
name: `jsenv:js_module_fallback_on_${subtype}`,
|
|
32
32
|
appliesDuring: "*",
|
|
33
33
|
init: (context) => {
|
|
34
|
+
if (Object.keys(context.runtimeCompat).toString() === "node") {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
34
37
|
if (context.isSupportedOnCurrentClients(`${subtype}_type_module`)) {
|
|
35
38
|
return false;
|
|
36
39
|
}
|
|
40
|
+
|
|
37
41
|
return true;
|
|
38
42
|
},
|
|
39
43
|
redirectReference: {
|