MCPcopy Index your code
hub / github.com/postcss/postcss / constructor

Method constructor

lib/css-syntax-error.js:8–39  ·  view source on GitHub ↗
(message, line, column, source, file, plugin)

Source from the content-addressed store, hash-verified

6
7class 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 + ': ' : ''

Callers

nothing calls this directly

Calls 1

setMessageMethod · 0.95

Tested by

no test coverage detected