webpack/lib/CommentCompilationWarning.js

40 lines
901 B
JavaScript
Raw Normal View History

2018-06-04 17:20:43 +08:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
2018-07-30 23:08:51 +08:00
2018-06-04 17:20:43 +08:00
"use strict";
const WebpackError = require("./WebpackError");
2018-10-25 16:47:52 +08:00
const makeSerializable = require("./util/makeSerializable");
2018-06-04 17:20:43 +08:00
2018-07-09 20:48:28 +08:00
/** @typedef {import("./Module")} Module */
2018-06-15 00:25:43 +08:00
2018-07-09 20:48:28 +08:00
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
2018-06-15 00:25:43 +08:00
2018-06-04 17:20:43 +08:00
class CommentCompilationWarning extends WebpackError {
2018-06-15 00:25:43 +08:00
/**
*
* @param {string} message warning message
* @param {Module} module affected module
* @param {DependencyLocation} loc affected lines of code
2018-06-15 00:25:43 +08:00
*/
2018-06-04 17:20:43 +08:00
constructor(message, module, loc) {
super(message);
this.name = "CommentCompilationWarning";
this.module = module;
this.loc = loc;
Error.captureStackTrace(this, this.constructor);
}
}
2018-10-25 16:47:52 +08:00
makeSerializable(
CommentCompilationWarning,
"webpack/lib/CommentCompilationWarning"
);
2018-06-04 17:20:43 +08:00
module.exports = CommentCompilationWarning;