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

Function warnDeprecation

packages/compiler-core/src/compat/compatConfig.ts:130–149  ·  view source on GitHub ↗
(
  key: CompilerDeprecationTypes,
  context: MergedParserOptions | TransformContext,
  loc: SourceLocation | null,
  ...args: any[]
)

Source from the content-addressed store, hash-verified

128}
129
130export function warnDeprecation(
131 key: CompilerDeprecationTypes,
132 context: MergedParserOptions | TransformContext,
133 loc: SourceLocation | null,
134 ...args: any[]
135): void {
136 const val = getCompatValue(key, context)
137 if (val === 'suppress-warning') {
138 return
139 }
140 const { message, link } = deprecationData[key]
141 const msg = `(deprecation ${key}) ${
142 typeof message === 'function' ? message(...args) : message
143 }${link ? `\n Details: ${link}` : ``}`
144
145 const err = new SyntaxError(msg) as CompilerError
146 err.code = key
147 if (loc) err.loc = loc
148 context.onWarn(err)
149}

Callers 3

onCloseTagFunction · 0.90
parseFilterFunction · 0.90
checkCompatEnabledFunction · 0.70

Calls 2

getCompatValueFunction · 0.85
messageFunction · 0.85

Tested by

no test coverage detected