(message, line, column, source, file, plugin)
| 6 | |
| 7 | class CssSyntaxError extends Error { |
| 8 | constructor(message, line, column, source, file, plugin) { |
| 9 | super(message) |
| 10 | this.name = 'CssSyntaxError' |
| 11 | this.reason = message |
| 12 | |
| 13 | if (file) { |
| 14 | this.file = file |
| 15 | } |
| 16 | if (source) { |
| 17 | this.source = source |
| 18 | } |
| 19 | if (plugin) { |
| 20 | this.plugin = plugin |
| 21 | } |
| 22 | if (typeof line !== 'undefined' && typeof column !== 'undefined') { |
| 23 | if (typeof line === 'number') { |
| 24 | this.line = line |
| 25 | this.column = column |
| 26 | } else { |
| 27 | this.line = line.line |
| 28 | this.column = line.column |
| 29 | this.endLine = column.line |
| 30 | this.endColumn = column.column |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | this.setMessage() |
| 35 | |
| 36 | if (Error.captureStackTrace) { |
| 37 | Error.captureStackTrace(this, CssSyntaxError) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | setMessage() { |
| 42 | this.message = this.plugin ? this.plugin + ': ' : '' |
nothing calls this directly
no test coverage detected