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

@ -69,6 +69,7 @@ const nodes = exports.nodes = {
if (state.hasCall && state.hasHelper || state.hasFunction) {
return state.hasFunction ? 1 | 2 : 2;
}
return 0;
},
SwitchCase(node, parent) {
return (!!node.consequent.length || parent.cases[0] === node ? 1 : 0) | (!node.consequent.length && parent.cases[parent.cases.length - 1] === node ? 2 : 0);
@ -77,21 +78,25 @@ const nodes = exports.nodes = {
if (isFunction(node.left) || isFunction(node.right)) {
return 2;
}
return 0;
},
Literal(node) {
if (isStringLiteral(node) && node.value === "use strict") {
return 2;
}
return 0;
},
CallExpression(node) {
if (isFunction(node.callee) || isHelper(node)) {
return 1 | 2;
}
return 0;
},
OptionalCallExpression(node) {
if (isFunction(node.callee)) {
return 1 | 2;
}
return 0;
},
VariableDeclaration(node) {
for (let i = 0; i < node.declarations.length; i++) {
@ -105,35 +110,41 @@ const nodes = exports.nodes = {
return 1 | 2;
}
}
return 0;
},
IfStatement(node) {
if (isBlockStatement(node.consequent)) {
return 1 | 2;
}
return 0;
}
};
nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
if (parent.properties[0] === node) {
return 1;
}
return 0;
};
nodes.ObjectTypeCallProperty = function (node, parent) {
var _parent$properties;
if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) {
return 1;
}
return 0;
};
nodes.ObjectTypeIndexer = function (node, parent) {
var _parent$properties2, _parent$callPropertie;
if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) {
return 1;
}
return 0;
};
nodes.ObjectTypeInternalSlot = function (node, parent) {
var _parent$properties3, _parent$callPropertie2, _parent$indexers;
if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) != null && _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) != null && _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) != null && _parent$indexers.length)) {
return 1;
}
return 0;
};
[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
[type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {