12345678910111213141516171819202122232425
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const WebpackError = require("./WebpackError");
  7. const cleanUp = require("./ErrorHelpers").cleanUp;
  8. class ModuleWarning extends WebpackError {
  9. constructor(module, warning) {
  10. super();
  11. this.name = "ModuleWarning";
  12. this.module = module;
  13. this.message = warning && typeof warning === "object" && warning.message ? warning.message : warning;
  14. this.warning = warning;
  15. this.details = warning && typeof warning === "object" && warning.stack ? cleanUp(warning.stack, this.message) : undefined;
  16. Error.captureStackTrace(this, this.constructor);
  17. }
  18. }
  19. module.exports = ModuleWarning;