Skip to content

Commit

Permalink
fix(compiler-sfc): add semicolon after defineProps statement (#6461)
Browse files Browse the repository at this point in the history
fix #6428
  • Loading branch information
sxzz committed Nov 8, 2022
1 parent 97aadd8 commit b72a4af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -640,7 +640,7 @@ export default {
setup(__props, { expose }) {
expose();

const props = __props
const props = __props;



Expand All @@ -658,7 +658,7 @@ export default {
setup(__props, { expose }) {
expose();

const props = __props
const props = __props;


return { props, x }
Expand All @@ -675,7 +675,7 @@ exports[`SFC compile <script setup> defineProps() 1`] = `
setup(__props, { expose }) {
expose();

const props = __props
const props = __props;


const bar = 1
Expand All @@ -693,7 +693,7 @@ exports[`SFC compile <script setup> defineProps/defineEmits in multi-variable de
setup(__props, { expose, emit }) {
expose();

const props = __props
const props = __props;



Expand All @@ -710,7 +710,7 @@ exports[`SFC compile <script setup> defineProps/defineEmits in multi-variable de
setup(__props, { expose, emit }) {
expose();

const props = __props
const props = __props;

const a = 1;

Expand Down Expand Up @@ -1611,7 +1611,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props, { expose, emit }) {
expose();

const props = __props
const props = __props;



Expand Down Expand Up @@ -1705,7 +1705,7 @@ const props = __props as {
foo?: string
bar?: number
baz: boolean
}
};



Expand All @@ -1728,7 +1728,7 @@ export default /*#__PURE__*/_defineComponent({
setup(__props: any, { expose }) {
expose();

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
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/compileScript.ts
Expand Up @@ -1411,7 +1411,7 @@ export function compileScript(
startOffset,
`\nconst ${propsIdentifier} = __props${
propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : ``
}\n`
};\n`
)
}
if (propsDestructureRestId) {
Expand Down

0 comments on commit b72a4af

Please sign in to comment.