Skip to content

Commit e7e5478

Browse files
refactor(lib/Error): remove unused branches (#302)
1 parent d39b84e commit e7e5478

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/Error.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,11 @@ class SyntaxError extends Error {
44
constructor (err) {
55
super(err)
66

7-
this.err = err.input.source
8-
97
this.name = 'Syntax Error'
10-
this.message = ''
118

12-
if (err.line) {
13-
this.message += `${this.name} \n\n(${err.line}:${err.column}) ${err.reason}`
14-
}
15-
16-
if (err.input.source) {
17-
this.message += `\n\n${err.showSourceCode()}\n`
18-
}
9+
this.message = ''
10+
this.message += `${this.name} \n\n(${err.line}:${err.column}) ${err.reason}`
11+
this.message += `\n\n${err.showSourceCode()}\n`
1912

2013
this.stack = false
2114
}

0 commit comments

Comments
 (0)