diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap
index da223439c57..082bfc884de 100644
--- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap
+++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap
@@ -1388,7 +1388,7 @@ export interface Emits { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }: { emit: ({ (e: 'foo' | 'bar'): void }), expose: any, slots: any, attrs: any }) {
+ setup(__props, { expose: __expose, emit }) {
__expose();
@@ -1405,7 +1405,7 @@ export type Emits = { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }: { emit: ({ (e: 'foo' | 'bar'): void }), expose: any, slots: any, attrs: any }) {
+ setup(__props, { expose: __expose, emit }) {
__expose();
@@ -1439,7 +1439,7 @@ interface Emits { (e: 'foo' | 'bar'): void }
export default /*#__PURE__*/_defineComponent({
emits: [\\"foo\\", \\"bar\\"],
- setup(__props, { expose: __expose, emit }: { emit: ({ (e: 'foo' | 'bar'): void }), expose: any, slots: any, attrs: any }) {
+ setup(__props, { expose: __expose, emit }) {
__expose();
@@ -1450,13 +1450,12 @@ return { emit }
})"
`;
-exports[`SFC compile
`)
assertCode(content)
- expect(content).toMatch(`emit: ((e: 'foo' | 'bar') => void),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1437,7 +1436,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: (${type}),`)
expect(content).toMatch(`emits: ["foo", "bar", "baz"]`)
})
@@ -1449,7 +1447,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1461,7 +1458,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1475,7 +1471,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1487,7 +1482,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1499,7 +1493,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1511,7 +1504,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: ((e: 'foo' | 'bar') => void),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1523,7 +1515,6 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`emit: ((e: 'foo' | 'bar') => void),`)
expect(content).toMatch(`emits: ["foo", "bar"]`)
})
@@ -1536,11 +1527,10 @@ const emit = defineEmits(['a', 'b'])
`)
assertCode(content)
- expect(content).toMatch(`setup(__props, { expose: __expose, emit }) {`)
expect(content).toMatch(`emits: ['foo']`)
})
- test('defineEmits w/ type (tuple syntax)', () => {
+ test('defineEmits w/ type (property syntax)', () => {
const { content } = compile(`