Skip to content

Commit 9395a08

Browse files
committed
fix(compiler-sfc): rename to X_DEFINE_MODEL_NO_ASSIGNMENT
1 parent f1872ff commit 9395a08

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/compiler-core/src/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export enum ErrorCodes {
9090
X_V_MODEL_ON_PROPS,
9191
X_INVALID_EXPRESSION,
9292
X_KEEP_ALIVE_INVALID_CHILDREN,
93-
X_DEFINE_MODEL_NO_VARIABLE,
93+
X_DEFINE_MODEL_NO_ASSIGNMENT,
9494
// generic errors
9595
X_PREFIX_ID_NOT_SUPPORTED,
9696
X_MODULE_MODE_NOT_SUPPORTED,
@@ -179,7 +179,7 @@ export const errorMessages: Record<ErrorCodes, string> = {
179179
[ErrorCodes.X_INVALID_EXPRESSION]: `Error parsing JavaScript expression: `,
180180
[ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN]: `<KeepAlive> expects exactly one child component.`,
181181
[ErrorCodes.X_VNODE_HOOKS]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
182-
[ErrorCodes.X_DEFINE_MODEL_NO_VARIABLE]: `defineModel() must be assigned to a variable. For example: const model = defineModel()`,
182+
[ErrorCodes.X_DEFINE_MODEL_NO_ASSIGNMENT]: `defineModel() must be assigned to a variable. For example: const model = defineModel()`,
183183

184184
// generic errors
185185
[ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED]: `"prefixIdentifiers" option is not supported in this build of compiler.`,

packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,6 @@ describe('defineModel()', () => {
277277
defineModel()
278278
</script>
279279
`),
280-
).toThrow(errorMessages[ErrorCodes.X_DEFINE_MODEL_NO_VARIABLE])
280+
).toThrow(errorMessages[ErrorCodes.X_DEFINE_MODEL_NO_ASSIGNMENT])
281281
})
282282
})

packages/compiler-sfc/src/script/defineModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function processDefineModel(
2828
}
2929

3030
if (!declId) {
31-
ctx.error(errorMessages[ErrorCodes.X_DEFINE_MODEL_NO_VARIABLE], node)
31+
ctx.error(errorMessages[ErrorCodes.X_DEFINE_MODEL_NO_ASSIGNMENT], node)
3232
}
3333

3434
ctx.hasDefineModelCall = true

0 commit comments

Comments
 (0)