wip: generate codeframe for compiler deprecations

This commit is contained in:
Evan You
2021-04-16 11:51:47 -04:00
parent d974adb327
commit 79cbf21c3e
4 changed files with 40 additions and 35 deletions

View File

@@ -124,13 +124,8 @@ export function warnDeprecation(
typeof message === 'function' ? message(...args) : message
}${link ? `\n Details: ${link}` : ``}`
if (loc) {
const err = new SyntaxError(msg) as CompilerError
err.code = key
err.loc = loc
context.onWarn(err)
return
}
context.onWarn(msg)
const err = new SyntaxError(msg) as CompilerError
err.code = key
if (loc) err.loc = loc
context.onWarn(err)
}