Add JS-CATCH-FALLBACK-01 rule and update npm packages
Add PHP-ALIAS-01 rule: prohibit field aliasing in serialization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
39
node_modules/webpack/lib/ModuleGraph.js
generated
vendored
39
node_modules/webpack/lib/ModuleGraph.js
generated
vendored
@@ -169,6 +169,12 @@ class ModuleGraph {
|
||||
* @private
|
||||
*/
|
||||
this._dependencySourceOrderMap = new WeakMap();
|
||||
|
||||
/**
|
||||
* @type {Set<Module>}
|
||||
* @private
|
||||
*/
|
||||
this._modulesNeedingSort = new Set();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,17 +311,15 @@ class ModuleGraph {
|
||||
// import { a, b } from "lib" -> a and b have the same source order -> a = b = 1
|
||||
// import { d } from "lib/d" -> d = 2
|
||||
const currentSourceOrder =
|
||||
/** @type { HarmonyImportSideEffectDependency | HarmonyImportSpecifierDependency} */ (
|
||||
dependency
|
||||
).sourceOrder;
|
||||
/** @type {HarmonyImportSideEffectDependency | HarmonyImportSpecifierDependency} */
|
||||
(dependency).sourceOrder;
|
||||
|
||||
// lib/index.js (reexport)
|
||||
// import { a } from "lib/a" -> a = 0
|
||||
// import { b } from "lib/b" -> b = 1
|
||||
const originSourceOrder =
|
||||
/** @type { HarmonyImportSideEffectDependency | HarmonyImportSpecifierDependency} */ (
|
||||
originDependency
|
||||
).sourceOrder;
|
||||
/** @type {HarmonyImportSideEffectDependency | HarmonyImportSpecifierDependency} */
|
||||
(originDependency).sourceOrder;
|
||||
if (
|
||||
typeof currentSourceOrder === "number" &&
|
||||
typeof originSourceOrder === "number"
|
||||
@@ -330,17 +334,28 @@ class ModuleGraph {
|
||||
sub: originSourceOrder
|
||||
});
|
||||
|
||||
// Save for later batch sorting
|
||||
this._modulesNeedingSort.add(parentModule);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
finishUpdateParent() {
|
||||
if (this._modulesNeedingSort.size === 0) {
|
||||
return;
|
||||
}
|
||||
for (const mod of this._modulesNeedingSort) {
|
||||
// If dependencies like HarmonyImportSideEffectDependency and HarmonyImportSpecifierDependency have a SourceOrder,
|
||||
// we sort based on it; otherwise, we preserve the original order.
|
||||
sortWithSourceOrder(
|
||||
parentModule.dependencies,
|
||||
this._dependencySourceOrderMap
|
||||
mod.dependencies,
|
||||
this._dependencySourceOrderMap,
|
||||
(dep, index) => this.setParentDependenciesBlockIndex(dep, index)
|
||||
);
|
||||
|
||||
for (const [index, dep] of parentModule.dependencies.entries()) {
|
||||
this.setParentDependenciesBlockIndex(dep, index);
|
||||
}
|
||||
}
|
||||
this._modulesNeedingSort.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user