From: Evan You Date: Mon, 29 Mar 2021 20:38:07 +0000 (-0400) Subject: fix(compiler-sfc): support proper type arguments for defineEmit helper X-Git-Tag: v3.0.10~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb8cdcad9f91f099c12ad78afacfc909e6269a7c;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): support proper type arguments for defineEmit helper fix #2874 --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index c27f0aeabe..f648f39e8f 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -692,7 +692,7 @@ return { a, b, c, d, x } }" `; -exports[`SFC compile + `) + ).toThrow() + }) + + test('defineEmit w/ type (type literal w/ call signatures)', () => { + const type = `{(e: 'foo' | 'bar'): void; (e: 'baz', id: number): void;}` const { content } = compile(`