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): fix macro definition to preserve semicolons in some sceniarios #7810

Closed

Conversation

yangxiuxiu1115
Copy link
Contributor

fix #7805

Copy link
Member

@baiwusanyu-c baiwusanyu-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<script setup lang="ts">
console.log('Oups...')
const a = defineProps(['b'])
(window.testFunc) = () => 'props'
</script>
<script setup lang="ts">
console.log('Oups...')
const a = defineProps(['b']);
(window.testFunc) = () => 'props'
</script>
<script setup lang="ts">
console.log('Oups...')
defineProps(['b'])
;(window.testFunc) = () => 'props'
</script>

This case will still report an error

@@ -1277,7 +1290,6 @@ const emit = defineEmits(['a', 'b'])
expect(content).toMatch(`emits: ["foo", "bar"]`)
})


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid adding or subtracting unnecessary spaces

@@ -1136,7 +1149,7 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
})

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid adding or subtracting unnecessary spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,thans

@yangxiuxiu1115
Copy link
Contributor Author

yangxiuxiu1115 commented Mar 1, 2023

I think the first are not necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vue 3 SFC Compiler function call with semicolon bug.
2 participants