(msg: string, column: number)
| 32 | } |
| 33 | |
| 34 | constructError(msg: string, column: number): Error { |
| 35 | let error = new Error(msg); |
| 36 | try { |
| 37 | throw error; |
| 38 | } catch (base) { |
| 39 | /* istanbul ignore else */ |
| 40 | if (Object.create && Object.defineProperty) { |
| 41 | error = Object.create(base); |
| 42 | Object.defineProperty(error, 'column', { value: column }); |
| 43 | } |
| 44 | } |
| 45 | /* istanbul ignore next */ |
| 46 | return error; |
| 47 | } |
| 48 | |
| 49 | createError(index: number, line: number, col: number, description: string): Error { |
| 50 | const msg = 'Line ' + line + ': ' + description; |