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

Function generateError

packages/compiler-sfc/src/script/context.ts:153–165  ·  view source on GitHub ↗
(
  msg: string,
  node: Node,
  ctx: ScriptCompileContext,
  scope?: TypeScope,
)

Source from the content-addressed store, hash-verified

151}
152
153function generateError(
154 msg: string,
155 node: Node,
156 ctx: ScriptCompileContext,
157 scope?: TypeScope,
158) {
159 const offset = scope ? scope.offset : ctx.startOffset!
160 return `${msg}\n\n${(scope || ctx.descriptor).filename}\n${generateCodeFrame(
161 (scope || ctx.descriptor).source,
162 node.start! + offset,
163 node.end! + offset,
164 )}`
165}
166
167export function resolveParserPlugins(
168 lang: string,

Callers 2

warnMethod · 0.85
errorMethod · 0.85

Calls 1

generateCodeFrameFunction · 0.90

Tested by

no test coverage detected