]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: error
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 1 Dec 2023 16:18:27 +0000 (00:18 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 1 Dec 2023 16:18:27 +0000 (00:18 +0800)
packages/compiler-vapor/src/transform.ts

index 7b9c5e206cd4c2102f72a2426218a4ed82c030d4..edce93fae9f494635438d504c776b41738339776 100644 (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