File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 99 * @param {Object } err CssSyntaxError
1010 */
1111class SyntaxError extends Error {
12- constructor ( err ) {
13- super ( err )
12+ constructor ( error ) {
13+ super ( error )
1414
15- const { line, column, reason } = err
15+ const { line, column, reason } = error
1616
1717 this . name = 'SyntaxError'
1818
19- this . message = ''
20- this . message += `${ this . name } \n\n(${ line } :${ column } ) ${ reason } `
21- this . message += `\n\n${ err . showSourceCode ( ) } \n`
19+ this . message = `${ this . name } \n\n`
20+
21+ if ( typeof line !== 'undefined' ) {
22+ this . message += `(${ line } :${ column } ) `
23+ }
24+
25+ this . message += `${ reason } `
26+
27+ const code = error . showSourceCode ( )
28+
29+ if ( code ) {
30+ this . message += `\n\n${ code } \n`
31+ }
2232
2333 this . stack = false
2434 }
Original file line number Diff line number Diff line change 11// Jest Snapshot v1, https://goo.gl/fbAQLP
22
33exports [` Errors Syntax Error 1` ] = `
4- "SyntaxError
4+ "SyntaxError
55
66(1:3) Unexpected separator in property
77
You can’t perform that action at this time.
0 commit comments