main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[79a0317] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | Author Tobias Koppers @sokra
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | "use strict";
|
---|
| 7 |
|
---|
| 8 | const WebpackError = require("./WebpackError");
|
---|
| 9 | const makeSerializable = require("./util/makeSerializable");
|
---|
| 10 |
|
---|
| 11 | /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
|
---|
| 12 | /** @typedef {import("./Module")} Module */
|
---|
| 13 |
|
---|
| 14 | class ModuleDependencyWarning extends WebpackError {
|
---|
| 15 | /**
|
---|
| 16 | * @param {Module} module module tied to dependency
|
---|
| 17 | * @param {Error} err error thrown
|
---|
| 18 | * @param {DependencyLocation} loc location of dependency
|
---|
| 19 | */
|
---|
| 20 | constructor(module, err, loc) {
|
---|
| 21 | super(err ? err.message : "");
|
---|
| 22 |
|
---|
| 23 | this.name = "ModuleDependencyWarning";
|
---|
| 24 | this.details =
|
---|
| 25 | err && !(/** @type {any} */ (err).hideStack)
|
---|
| 26 | ? /** @type {string} */ (err.stack).split("\n").slice(1).join("\n")
|
---|
| 27 | : undefined;
|
---|
| 28 | this.module = module;
|
---|
| 29 | this.loc = loc;
|
---|
| 30 | /** error is not (de)serialized, so it might be undefined after deserialization */
|
---|
| 31 | this.error = err;
|
---|
| 32 |
|
---|
| 33 | if (err && /** @type {any} */ (err).hideStack && err.stack) {
|
---|
| 34 | this.stack = /** @type {string} */ `${err.stack
|
---|
| 35 | .split("\n")
|
---|
| 36 | .slice(1)
|
---|
| 37 | .join("\n")}\n\n${this.stack}`;
|
---|
| 38 | }
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | makeSerializable(
|
---|
| 43 | ModuleDependencyWarning,
|
---|
| 44 | "webpack/lib/ModuleDependencyWarning"
|
---|
| 45 | );
|
---|
| 46 |
|
---|
| 47 | module.exports = ModuleDependencyWarning;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.