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:
25
node_modules/webpack/lib/Template.js
generated
vendored
25
node_modules/webpack/lib/Template.js
generated
vendored
@@ -280,7 +280,7 @@ class Template {
|
||||
/**
|
||||
* @param {ChunkRenderContext} renderContext render context
|
||||
* @param {Module[]} modules modules to render (should be ordered by identifier)
|
||||
* @param {(module: Module) => Source | null} renderModule function to render a module
|
||||
* @param {(module: Module, renderInArray?: boolean) => Source | null} renderModule function to render a module
|
||||
* @param {string=} prefix applying prefix strings
|
||||
* @returns {Source | null} rendered chunk modules in a Source object or null if no modules
|
||||
*/
|
||||
@@ -290,12 +290,20 @@ class Template {
|
||||
if (modules.length === 0) {
|
||||
return null;
|
||||
}
|
||||
/** @type {{ id: ModuleId, source: Source | "false" }[]} */
|
||||
const allModules = modules.map((module) => ({
|
||||
id: /** @type {ModuleId} */ (chunkGraph.getModuleId(module)),
|
||||
source: renderModule(module) || "false"
|
||||
/** @type {{ id: ModuleId, module: Module }[]} */
|
||||
const modulesWithId = modules.map((m) => ({
|
||||
id: /** @type {ModuleId} */ (chunkGraph.getModuleId(m)),
|
||||
module: m
|
||||
}));
|
||||
const bounds = Template.getModulesArrayBounds(allModules);
|
||||
const bounds = Template.getModulesArrayBounds(modulesWithId);
|
||||
const renderInObject = bounds === false;
|
||||
|
||||
/** @type {{ id: ModuleId, source: Source | "false" }[]} */
|
||||
const allModules = modulesWithId.map(({ id, module }) => ({
|
||||
id,
|
||||
source: renderModule(module, renderInObject) || "false"
|
||||
}));
|
||||
|
||||
if (bounds) {
|
||||
// Render a spare array
|
||||
const minId = bounds[0];
|
||||
@@ -332,7 +340,9 @@ class Template {
|
||||
if (i !== 0) {
|
||||
source.add(",\n");
|
||||
}
|
||||
source.add(`\n/***/ ${JSON.stringify(module.id)}:\n`);
|
||||
source.add(
|
||||
`\n/***/ ${JSON.stringify(module.id)}${renderContext.runtimeTemplate.supportsMethodShorthand() && module.source !== "false" ? "" : ":"}\n`
|
||||
);
|
||||
source.add(module.source);
|
||||
}
|
||||
source.add(`\n\n${prefix}}`);
|
||||
@@ -363,6 +373,7 @@ class Template {
|
||||
moduleGraph: renderContext.moduleGraph,
|
||||
runtimeTemplate: renderContext.runtimeTemplate,
|
||||
runtime: renderContext.chunk.runtime,
|
||||
runtimes: [renderContext.chunk.runtime],
|
||||
codeGenerationResults
|
||||
});
|
||||
if (!codeGenResult) continue;
|
||||
|
||||
Reference in New Issue
Block a user