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:
37
node_modules/webpack/lib/HookWebpackError.js
generated
vendored
37
node_modules/webpack/lib/HookWebpackError.js
generated
vendored
@@ -6,6 +6,10 @@
|
||||
"use strict";
|
||||
|
||||
const WebpackError = require("./WebpackError");
|
||||
const makeSerializable = require("./util/makeSerializable");
|
||||
|
||||
/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
||||
/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
@@ -22,18 +26,43 @@ class HookWebpackError extends WebpackError {
|
||||
* @param {string} hook name of hook
|
||||
*/
|
||||
constructor(error, hook) {
|
||||
super(error.message);
|
||||
super(error ? error.message : undefined, error ? { cause: error } : {});
|
||||
|
||||
this.name = "HookWebpackError";
|
||||
this.hook = hook;
|
||||
this.error = error;
|
||||
this.name = "HookWebpackError";
|
||||
this.hideStack = true;
|
||||
this.details = `caused by plugins in ${hook}\n${error.stack}`;
|
||||
this.stack += `\n-- inner error --\n${error ? error.stack : ""}`;
|
||||
this.details = `caused by plugins in ${hook}\n${error ? error.stack : ""}`;
|
||||
}
|
||||
|
||||
this.stack += `\n-- inner error --\n${error.stack}`;
|
||||
/**
|
||||
* @param {ObjectSerializerContext} context context
|
||||
*/
|
||||
serialize(context) {
|
||||
const { write } = context;
|
||||
|
||||
write(this.error);
|
||||
write(this.hook);
|
||||
|
||||
super.serialize(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ObjectDeserializerContext} context context
|
||||
*/
|
||||
deserialize(context) {
|
||||
const { read } = context;
|
||||
|
||||
this.error = read();
|
||||
this.hook = read();
|
||||
|
||||
super.deserialize(context);
|
||||
}
|
||||
}
|
||||
|
||||
makeSerializable(HookWebpackError, "webpack/lib/HookWebpackError");
|
||||
|
||||
module.exports = HookWebpackError;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user