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:
26
node_modules/webpack/lib/asset/AssetSourceGenerator.js
generated
vendored
Executable file → Normal file
26
node_modules/webpack/lib/asset/AssetSourceGenerator.js
generated
vendored
Executable file → Normal file
@@ -9,16 +9,20 @@ const { RawSource } = require("webpack-sources");
|
||||
const ConcatenationScope = require("../ConcatenationScope");
|
||||
const Generator = require("../Generator");
|
||||
const {
|
||||
CSS_TYPE,
|
||||
CSS_URL_TYPE,
|
||||
CSS_URL_TYPES,
|
||||
JS_AND_CSS_URL_TYPES,
|
||||
JS_TYPES,
|
||||
JAVASCRIPT_AND_CSS_URL_TYPES,
|
||||
JAVASCRIPT_TYPE,
|
||||
JAVASCRIPT_TYPES,
|
||||
NO_TYPES
|
||||
} = require("../ModuleSourceTypesConstants");
|
||||
} = require("../ModuleSourceTypeConstants");
|
||||
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../Generator").GenerateContext} GenerateContext */
|
||||
/** @typedef {import("../Module").ConcatenationBailoutReasonContext} ConcatenationBailoutReasonContext */
|
||||
/** @typedef {import("../Module").SourceType} SourceType */
|
||||
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
||||
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
||||
/** @typedef {import("../NormalModule")} NormalModule */
|
||||
@@ -46,7 +50,7 @@ class AssetSourceGenerator extends Generator {
|
||||
const data = getData ? getData() : undefined;
|
||||
|
||||
switch (type) {
|
||||
case "javascript": {
|
||||
case JAVASCRIPT_TYPE: {
|
||||
if (!originalSource) {
|
||||
return new RawSource("");
|
||||
}
|
||||
@@ -71,7 +75,7 @@ class AssetSourceGenerator extends Generator {
|
||||
}
|
||||
return new RawSource(sourceContent);
|
||||
}
|
||||
case "css-url": {
|
||||
case CSS_URL_TYPE: {
|
||||
if (!originalSource) {
|
||||
return null;
|
||||
}
|
||||
@@ -98,7 +102,7 @@ class AssetSourceGenerator extends Generator {
|
||||
*/
|
||||
generateError(error, module, generateContext) {
|
||||
switch (generateContext.type) {
|
||||
case "javascript": {
|
||||
case JAVASCRIPT_TYPE: {
|
||||
return new RawSource(
|
||||
`throw new Error(${JSON.stringify(error.message)});`
|
||||
);
|
||||
@@ -135,12 +139,12 @@ class AssetSourceGenerator extends Generator {
|
||||
}
|
||||
|
||||
if (sourceTypes.size > 0) {
|
||||
if (sourceTypes.has("javascript") && sourceTypes.has("css")) {
|
||||
return JS_AND_CSS_URL_TYPES;
|
||||
} else if (sourceTypes.has("css")) {
|
||||
if (sourceTypes.has(JAVASCRIPT_TYPE) && sourceTypes.has(CSS_TYPE)) {
|
||||
return JAVASCRIPT_AND_CSS_URL_TYPES;
|
||||
} else if (sourceTypes.has(CSS_TYPE)) {
|
||||
return CSS_URL_TYPES;
|
||||
}
|
||||
return JS_TYPES;
|
||||
return JAVASCRIPT_TYPES;
|
||||
}
|
||||
|
||||
return NO_TYPES;
|
||||
@@ -148,7 +152,7 @@ class AssetSourceGenerator extends Generator {
|
||||
|
||||
/**
|
||||
* @param {NormalModule} module the module
|
||||
* @param {string=} type source type
|
||||
* @param {SourceType=} type source type
|
||||
* @returns {number} estimate size of the module
|
||||
*/
|
||||
getSize(module, type) {
|
||||
|
||||
Reference in New Issue
Block a user