Skip to content

Commit

Permalink
fix(compiler-sfc): add semicolon after defineProps statement (#12879)
Browse files Browse the repository at this point in the history
  • Loading branch information
liulinboyi committed Oct 23, 2023
1 parent b8c8b3f commit 51fef2c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/compiler-sfc/src/compileScript.ts
Expand Up @@ -1125,15 +1125,15 @@ export function compileScript(
startOffset,
`\nconst ${propsIdentifier} = __props${
propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : ``
}\n`
};\n`
)
}
if (propsDestructureRestId) {
s.prependLeft(
startOffset,
`\nconst ${propsDestructureRestId} = ${helper(
`createPropsRestProxy`
)}(__props, ${JSON.stringify(Object.keys(propsDestructuredBindings))})\n`
)}(__props, ${JSON.stringify(Object.keys(propsDestructuredBindings))});\n`
)
}

Expand Down
Expand Up @@ -212,7 +212,7 @@ export default {
props: propsModel,
setup(__props) {
const props = __props
const props = __props;
Expand All @@ -229,7 +229,7 @@ export default {
props: {},
setup(__props) {
const props = __props
const props = __props;
return { props, x }
Expand All @@ -245,7 +245,7 @@ exports[`SFC compile <script setup> > defineProps() 1`] = `
},
setup(__props) {
const props = __props
const props = __props;
const bar = 1
Expand All @@ -262,7 +262,7 @@ exports[`SFC compile <script setup> > defineProps/defineEmits in multi-variable
emits: ['a'],
setup(__props, { emit }) {
const props = __props
const props = __props;
Expand All @@ -278,7 +278,7 @@ exports[`SFC compile <script setup> > defineProps/defineEmits in multi-variable
emits: ['a'],
setup(__props, { emit }) {
const props = __props
const props = __props;
const a = 1;
Expand Down Expand Up @@ -835,7 +835,7 @@ export default /*#__PURE__*/_defineComponent({
emits: ['a', 'b'],
setup(__props, { emit }) {
const props = __props
const props = __props;
Expand Down Expand Up @@ -924,7 +924,7 @@ const props = __props as {
foo?: string
bar?: number
baz: boolean
}
};
Expand All @@ -946,7 +946,7 @@ export default /*#__PURE__*/_defineComponent({
},
setup(__props: any) {
const props = __props as { foo: string, bar?: number, baz: boolean, qux(): number }
const props = __props as { foo: string, bar?: number, baz: boolean, qux(): number };
Expand Down

0 comments on commit 51fef2c

Please sign in to comment.