refactor(compiler-core): use directive name in error code identifier (#163)

This commit is contained in:
Rahul Kadyan
2019-10-09 19:57:24 +05:30
committed by Evan You
parent 723dc8791b
commit 19c65a61ea
10 changed files with 52 additions and 49 deletions

View File

@@ -46,7 +46,7 @@ export const transformIf = createStructuralDirectiveTransform(
) {
const loc = dir.exp ? dir.exp.loc : node.loc
context.onError(
createCompilerError(ErrorCodes.X_IF_NO_EXPRESSION, dir.loc)
createCompilerError(ErrorCodes.X_V_IF_NO_EXPRESSION, dir.loc)
)
dir.exp = createSimpleExpression(`true`, false, loc)
}
@@ -125,7 +125,7 @@ export const transformIf = createStructuralDirectiveTransform(
}
} else {
context.onError(
createCompilerError(ErrorCodes.X_ELSE_NO_ADJACENT_IF, node.loc)
createCompilerError(ErrorCodes.X_V_ELSE_NO_ADJACENT_IF, node.loc)
)
}
break