3 exports.__esModule = true;
5 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7 var Warning = function () {
8 function Warning(text) {
9 var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
11 _classCallCheck(this, Warning);
13 this.type = 'warning';
17 if (opts.node && opts.node.source) {
18 var pos = opts.node.positionBy(opts);
20 this.column = pos.column;
23 for (var opt in opts) {
24 this[opt] = opts[opt];
28 Warning.prototype.toString = function toString() {
30 return this.node.error(this.text, {
35 } else if (this.plugin) {
36 return this.plugin + ': ' + this.text;
45 exports.default = Warning;
46 module.exports = exports['default'];