Function
createCompilerError
(
code: T,
loc?: SourceLocation,
messages?: { [code: number]: string },
additionalMessage?: string,
)
Source from the content-addressed store, hash-verified
| 22 | : CompilerError |
| 23 | |
| 24 | export function createCompilerError<T extends number>( |
| 25 | code: T, |
| 26 | loc?: SourceLocation, |
| 27 | messages?: { [code: number]: string }, |
| 28 | additionalMessage?: string, |
| 29 | ): InferCompilerError<T> { |
| 30 | const msg = |
| 31 | __DEV__ || !__BROWSER__ |
| 32 | ? (messages || errorMessages)[code] + (additionalMessage || ``) |
| 33 | : `https://vuejs.org/error-reference/#compiler-${code}` |
| 34 | const error = new SyntaxError(String(msg)) as InferCompilerError<T> |
| 35 | error.code = code |
| 36 | error.loc = loc |
| 37 | return error |
| 38 | } |
| 39 | |
| 40 | export enum ErrorCodes { |
| 41 | // parse errors |