From 1d42c25a4e34ccdbcfc49f33616890aacaf70e1b Mon Sep 17 00:00:00 2001 From: liulinboyi <814921718@qq.com> Date: Fri, 18 Nov 2022 19:45:09 +0800 Subject: [PATCH] fix(compiler-sfc): add semicolon after `defineProps` statement --- packages/compiler-sfc/src/compileScript.ts | 4 ++-- .../__snapshots__/compileScript.spec.ts.snap | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index db04dbef333..21fc3eb2ad1 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1122,7 +1122,7 @@ export function compileScript( startOffset, `\nconst ${propsIdentifier} = __props${ propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : `` - }\n` + };\n` ) } if (propsDestructureRestId) { @@ -1130,7 +1130,7 @@ export function compileScript( startOffset, `\nconst ${propsDestructureRestId} = ${helper( `createPropsRestProxy` - )}(__props, ${JSON.stringify(Object.keys(propsDestructuredBindings))})\n` + )}(__props, ${JSON.stringify(Object.keys(propsDestructuredBindings))});\n` ) } diff --git a/packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap index bb52a66b907..8cf67a1a3d4 100644 --- a/packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap @@ -212,7 +212,7 @@ export default { props: propsModel, setup(__props) { -const props = __props +const props = __props; @@ -229,7 +229,7 @@ export default { props: {}, setup(__props) { -const props = __props +const props = __props; return { props, x } @@ -245,7 +245,7 @@ exports[`SFC compile