chore: remove line numbers from default errors
This commit is contained in:
parent
865c1ce9ee
commit
b15951e190
@ -19,8 +19,7 @@ export function createCompilerError<T extends number>(
|
|||||||
messages?: { [code: number]: string }
|
messages?: { [code: number]: string }
|
||||||
): T extends ErrorCodes ? CoreCompilerError : CompilerError {
|
): T extends ErrorCodes ? CoreCompilerError : CompilerError {
|
||||||
const msg = __DEV__ || !__BROWSER__ ? (messages || errorMessages)[code] : code
|
const msg = __DEV__ || !__BROWSER__ ? (messages || errorMessages)[code] : code
|
||||||
const locInfo = loc ? ` (${loc.start.line}:${loc.start.column})` : ``
|
const error = new SyntaxError(String(msg)) as CompilerError
|
||||||
const error = new SyntaxError(msg + locInfo) as CompilerError
|
|
||||||
error.code = code
|
error.code = code
|
||||||
error.loc = loc
|
error.loc = loc
|
||||||
return error as any
|
return error as any
|
||||||
|
Loading…
Reference in New Issue
Block a user