MCPcopy Index your code
hub / github.com/webpack/webpack / constructor

Method constructor

lib/errors/ModuleWarning.js:21–43  ·  view source on GitHub ↗

* Creates an instance of ModuleWarning. * @param {Error} warning error thrown * @param {{ from?: string | null }} info additional info

(warning, { from = null } = {})

Source from the content-addressed store, hash-verified

19 * @param {{ from?: string | null }} info additional info
20 */
21 constructor(warning, { from = null } = {}) {
22 let message = "Module Warning";
23
24 message += from ? ` (from ${from}):\n` : ": ";
25
26 if (warning && typeof warning === "object" && warning.message) {
27 message += warning.message;
28 } else if (warning) {
29 message += String(warning);
30 }
31
32 super(message);
33
34 /** @type {string} */
35 this.name = "ModuleWarning";
36 /** @type {Error} */
37 this.warning = warning;
38 /** @type {string | undefined} */
39 this.details =
40 warning && typeof warning === "object" && warning.stack
41 ? cleanUp(warning.stack, this.message)
42 : undefined;
43 }
44
45 /**
46 * Serializes this instance into the provided serializer context.

Callers

nothing calls this directly

Calls 1

cleanUpFunction · 0.85

Tested by

no test coverage detected