fix: excessive calls of getAllReferences
Github Actions / lint (push) Has been cancelled Details
Github Actions / basic (push) Has been cancelled Details
Github Actions / validate-legacy-node (push) Has been cancelled Details
Github Actions / unit (push) Has been cancelled Details
Github Actions / integration (10.x, macos-latest, a) (push) Has been cancelled Details
Github Actions / integration (10.x, macos-latest, b) (push) Has been cancelled Details
Github Actions / integration (10.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (10.x, ubuntu-latest, b) (push) Has been cancelled Details
Github Actions / integration (10.x, windows-latest, a) (push) Has been cancelled Details
Github Actions / integration (10.x, windows-latest, b) (push) Has been cancelled Details
Github Actions / integration (12.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (14.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (16.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (18.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (18.x, ubuntu-latest, b) (push) Has been cancelled Details
Github Actions / integration (20.x, macos-latest, a) (push) Has been cancelled Details
Github Actions / integration (20.x, macos-latest, b) (push) Has been cancelled Details
Github Actions / integration (20.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (20.x, ubuntu-latest, b) (push) Has been cancelled Details
Github Actions / integration (20.x, windows-latest, a) (push) Has been cancelled Details
Github Actions / integration (20.x, windows-latest, b) (push) Has been cancelled Details
Github Actions / integration (22.x, macos-latest, a) (push) Has been cancelled Details
Github Actions / integration (22.x, macos-latest, b) (push) Has been cancelled Details
Github Actions / integration (22.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (22.x, ubuntu-latest, b) (push) Has been cancelled Details
Github Actions / integration (22.x, windows-latest, a) (push) Has been cancelled Details
Github Actions / integration (22.x, windows-latest, b) (push) Has been cancelled Details
Github Actions / integration (23.x, ubuntu-latest, a) (push) Has been cancelled Details
Github Actions / integration (23.x, ubuntu-latest, b) (push) Has been cancelled Details
Github Actions / integration (lts/*, ubuntu-latest, a, 1) (push) Has been cancelled Details
Github Actions / integration (lts/*, ubuntu-latest, b, 1) (push) Has been cancelled Details

This commit is contained in:
Alexander Akait 2025-03-24 20:50:26 +03:00 committed by GitHub
commit 031a76df03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 8 deletions

View File

@ -1606,12 +1606,6 @@ class JavascriptModulesPlugin {
} }
for (const variable of info.variables) { for (const variable of info.variables) {
allUsedNames.add(variable.name);
const references = getAllReferences(variable);
const allIdentifiers = new Set(
references.map(r => r.identifier).concat(variable.identifiers)
);
const usedNamesInScopeInfo = new Map(); const usedNamesInScopeInfo = new Map();
const ignoredScopes = new Set(); const ignoredScopes = new Set();
@ -1624,6 +1618,9 @@ class JavascriptModulesPlugin {
if (allUsedNames.has(name) || usedNames.has(name)) { if (allUsedNames.has(name) || usedNames.has(name)) {
const references = getAllReferences(variable); const references = getAllReferences(variable);
const allIdentifiers = new Set(
references.map(r => r.identifier).concat(variable.identifiers)
);
for (const ref of references) { for (const ref of references) {
addScopeSymbols( addScopeSymbols(
ref.from, ref.from,
@ -1658,9 +1655,8 @@ class JavascriptModulesPlugin {
} }
source.replace(r[0], r[1] - 1, newName); source.replace(r[0], r[1] - 1, newName);
} }
} else {
allUsedNames.add(name);
} }
allUsedNames.add(name);
} }
renamedInlinedModules.set(m, source); renamedInlinedModules.set(m, source);