v1.0 with SW PWA enabled

This commit is contained in:
Blomios
2026-01-01 17:40:53 +01:00
parent 1c0e22aac1
commit 3c8bebb2ad
29775 changed files with 2197201 additions and 119080 deletions

View File

@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
exports.default = void 0;
var _renamer = require("./lib/renamer.js");
var _index = require("../index.js");
var _traverseForScope = require("./traverseForScope.js");
var _binding = require("./binding.js");
var _t = require("@babel/types");
var t = _t;
@ -186,6 +187,9 @@ function resetScope(scope) {
scope.bindings = Object.create(null);
scope.globals = Object.create(null);
}
function isAnonymousFunctionExpression(path) {
return path.isFunctionExpression() && !path.node.id || path.isArrowFunctionExpression();
}
{
var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
}
@ -677,6 +681,7 @@ class Scope {
}
crawl() {
const path = this.path;
;
resetScope(this);
this.data = Object.create(null);
let scope = this;
@ -699,9 +704,6 @@ class Scope {
}
}, collectorVisitor]));
if (path.type !== "Program") {
for (const visit of scopeVisitor.enter) {
visit.call(state, path, state);
}
const typeVisitors = scopeVisitor[path.type];
if (typeVisitors) {
for (const visit of typeVisitors.enter) {
@ -709,7 +711,9 @@ class Scope {
}
}
}
path.traverse(scopeVisitor, state);
{
path.traverse(scopeVisitor, state);
}
this.crawling = false;
for (const path of state.assignments) {
const ids = path.getAssignmentIdentifiers();
@ -747,7 +751,7 @@ class Scope {
kind = "var",
id
} = opts;
if (!init && !unique && (kind === "var" || kind === "let") && path.isFunction() && !path.node.name && isCallExpression(path.parent, {
if (!init && !unique && (kind === "var" || kind === "let") && isAnonymousFunctionExpression(path) && isCallExpression(path.parent, {
callee: path.node
}) && path.parent.arguments.length <= path.node.params.length && isIdentifier(id)) {
path.pushContainer("params", id);
@ -936,7 +940,7 @@ class Scope {
emit(identifier(name), decl.init != null);
}
}
if (parentPath.parentPath.isFor({
if (parentPath.parentPath.isForXStatement({
left: parent
})) {
parentPath.replaceWith(firstId);