MCPcopy
hub / github.com/vuejs/core / createCompilerError

Function createCompilerError

packages/compiler-core/src/errors.ts:24–38  ·  view source on GitHub ↗
(
  code: T,
  loc?: SourceLocation,
  messages?: { [code: number]: string },
  additionalMessage?: string,
)

Source from the content-addressed store, hash-verified

22 : CompilerError
23
24export 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
40export enum ErrorCodes {
41 // parse errors

Callers 15

createDOMCompilerErrorFunction · 0.90
emitErrorFunction · 0.90
baseCompileFunction · 0.90
transformBindFunction · 0.90
processSlotOutletFunction · 0.90
processIfFunction · 0.90
transformOnFunction · 0.90
buildSlotsFunction · 0.90
transformVBindShorthandFunction · 0.90
vFor.tsFile · 0.90
processForFunction · 0.90

Calls 1

StringInterface · 0.85

Tested by 1

pluginFunction · 0.72