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 #6461

Merged
merged 1 commit into from Nov 8, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Expand Up @@ -160,7 +160,7 @@ export default {
props: ['foo', 'bar', 'baz'],
setup(__props) {

const rest = _createPropsRestProxy(__props, [\\"foo\\",\\"bar\\"])
const rest = _createPropsRestProxy(__props, [\\"foo\\",\\"bar\\"]);



Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-sfc/src/compileScript.ts
Expand Up @@ -1411,15 +1411,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`
)
}
// inject temp variables for async context preservation
Expand Down