@@ -25412,13 +25412,14 @@ const installImprove = (modules) => {
2541225412 * @param {Node} node a node
2541325413 * @returns {boolean} true where it does
2541425414 */
25415- const isGlobalObjectRef = (node) =>
25416- A.isSymbolRefNode(node) &&
25417- (GLOBAL_OBJECT_NAMES.has(node.name)
25418- ? isUndeclaredRef(node)
25419- : GLOBAL_OBJECT_NAMES.has(
25420- /** @type {string} */ (parameterAliases.get(node.definition))
25421- ));
25415+ const isGlobalObjectRef = (node) => {
25416+ if (!A.isSymbolRefNode(node)) return false;
25417+ // A parameter named `globalThis` stands for what it is handed.
25418+ const alias = parameterAliases.get(node.definition);
25419+ return alias !== undefined
25420+ ? GLOBAL_OBJECT_NAMES.has(alias)
25421+ : GLOBAL_OBJECT_NAMES.has(node.name) && isUndeclaredRef(node);
25422+ };
2542225423 /**
2542325424 * The global a read names, `Array` or `globalThis.Array`, with
2542425425 * `ANY_GLOBAL` for a key through the global object that is not known.
@@ -25540,8 +25541,9 @@ const installImprove = (modules) => {
2554025541 patchedPrototypes.add(global);
2554125542 }
2554225543 for (const global of pureGlobals) patchedStatics.add(global);
25543- } else if (BUILT_IN_PROTOTYPES_NAMES.has(name)) {
25544- patchedPrototypes.add(name);
25544+ } else {
25545+ patchedStatics.add(name);
25546+ if (BUILT_IN_PROTOTYPES_NAMES.has(name)) patchedPrototypes.add(name);
2554525547 }
2554625548 };
2554725549 const compressBeforeProbes = compressorMethods.compress;
@@ -25670,12 +25672,15 @@ const installImprove = (modules) => {
2567025672 (parameter !== undefined && !A.isSymbolFunargNode(parameter))
2567125673 ) {
2567225674 handedAway(name);
25673- } else if (
25674- parameter !== undefined &&
25675- !parameterAliases.has(parameter.definition)
25676- ) {
25677- parameterAliases.set(parameter.definition, name);
25678- A.walkNode(lambda, walker);
25675+ } else if (parameter !== undefined) {
25676+ const alias = parameterAliases.get(parameter.definition);
25677+ if (alias === undefined) {
25678+ parameterAliases.set(parameter.definition, name);
25679+ A.walkNode(lambda, walker);
25680+ } else if (alias !== name) {
25681+ // Read for one, the function is handed another as well.
25682+ handedAway(name);
25683+ }
2567925684 }
2568025685 }
2568125686 }
@@ -25817,7 +25822,7 @@ const installImprove = (modules) => {
2581725822 self.arguments.length === 1 &&
2581825823 A.isSymbolRefNode(self.callee) &&
2581925824 self.callee.name === "Array" &&
25820- isUndeclaredRef (self.callee) &&
25825+ readsUnassignedGlobal (self.callee, compressor ) &&
2582125826 A.isUnaryPrefixNode(length) &&
2582225827 length.operator === "-" &&
2582325828 A.isNumberNode(length.argument) &&
0 commit comments