From 51fef2ca69459c1175e105991f60511f1996e0c8 Mon Sep 17 00:00:00 2001 From: Liu Bo Date: Mon, 23 Oct 2023 15:09:23 +0800 Subject: [PATCH] fix(compiler-sfc): add semicolon after `defineProps` statement (#12879) --- 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 8039b41e1..abb6d8b13 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1125,7 +1125,7 @@ export function compileScript( startOffset, `\nconst ${propsIdentifier} = __props${ propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : `` - }\n` + };\n` ) } if (propsDestructureRestId) { @@ -1133,7 +1133,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 594c909ee..e9046ea3c 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