refactor: error

This commit is contained in:
三咲智子 Kevin Deng 2023-12-02 00:18:27 +08:00
parent 13d0993cd3
commit f2512b5319
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 2 additions and 5 deletions

View File

@ -178,9 +178,6 @@ export function transform(
root: RootNode,
options: TransformOptions = {},
): RootIRNode {
options.onError ||= defaultOnError
options.onWarn ||= defaultOnWarn
const ir: RootIRNode = {
type: IRNodeTypes.ROOT,
node: root,
@ -449,7 +446,7 @@ function transformProp(
!exp ||
(exp.type === NodeTypes.SIMPLE_EXPRESSION && !exp.content.trim())
) {
ctx.options.onError!(
ctx.options.onError(
createCompilerError(ErrorCodes.X_V_BIND_NO_EXPRESSION, loc),
)
return
@ -480,7 +477,7 @@ function transformProp(
}
case 'on': {
if (!exp && !modifiers.length) {
ctx.options.onError!(
ctx.options.onError(
createCompilerError(ErrorCodes.X_V_ON_NO_EXPRESSION, loc),
)
return