Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler-sfc): add semicolon after defineProps statement #12879

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1122,15 +1122,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
Original file line number Diff line number Diff line change
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 @@ -803,7 +803,7 @@ export default /*#__PURE__*/_defineComponent({
emits: ['a', 'b'],
setup(__props, { emit }) {

const props = __props
const props = __props;



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



Expand All @@ -914,7 +914,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