Skip to content

Commit 1f7171e

Browse files
committed
feat(macros): add semicolon prefix for defineExpose
1 parent a0e16e8 commit 1f7171e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/macros/src/core/define-expose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function transformDefineExpose(
66
s: MagicStringAST,
77
lib: string,
88
): void {
9-
s.overwriteNode(node.callee, '')
9+
s.overwriteNode(node.callee, ';')
1010
s.appendRight(
1111
node.arguments[0]?.start || node.end! - 1,
1212
lib.includes('vapor')

packages/macros/tests/__snapshots__/fixtures.spec.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ let __temp, __restore
5454
exports[`fixtures > ./fixtures/define-expose.tsx 1`] = `
5555
"
5656
import { getCurrentInstance as __MACROS_getCurrentInstance } from "vue";export function Comp(__MACROS_props) {
57-
(__MACROS_getCurrentInstance().exposed = {
57+
;(__MACROS_getCurrentInstance().exposed = {
5858
foo: 1,
5959
})
6060
return <div />
6161
}
6262
6363
export const Comp1 = function (props: any) {
64-
(__MACROS_getCurrentInstance().exposed = {
64+
;(__MACROS_getCurrentInstance().exposed = {
6565
foo: props.foo,
6666
})
6767
return <div />
6868
}
6969
7070
export const Comp2 = ({ foo, ...__MACROS_props }: any) => {
71-
(__MACROS_getCurrentInstance().exposed = {
71+
;(__MACROS_getCurrentInstance().exposed = {
7272
foo,
7373
})
7474
return <div />
@@ -192,21 +192,21 @@ let __temp, __restore
192192
exports[`vue/vapor fixtures > ./fixtures/define-expose.tsx 1`] = `
193193
"
194194
import { currentInstance as __MACROS_currentInstance } from "vue";export function Comp(__MACROS_props) {
195-
(__MACROS_currentInstance.exposed = {
195+
;(__MACROS_currentInstance.exposed = {
196196
foo: 1,
197197
})
198198
return <div />
199199
}
200200
201201
export const Comp1 = function (props: any) {
202-
(__MACROS_currentInstance.exposed = {
202+
;(__MACROS_currentInstance.exposed = {
203203
foo: props.foo,
204204
})
205205
return <div />
206206
}
207207
208208
export const Comp2 = ({ foo, ...__MACROS_props }: any) => {
209-
(__MACROS_currentInstance.exposed = {
209+
;(__MACROS_currentInstance.exposed = {
210210
foo,
211211
})
212212
return <div />

0 commit comments

Comments
 (0)