From: 三咲智子 Kevin Deng Date: Tue, 28 Mar 2023 08:23:39 +0000 (+0800) Subject: fix(compiler-sfc): properly remove comma of multiple macros in the same declaration... X-Git-Tag: v3.3.0-alpha.6~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=336a3d7b9199aeda19672832ce173de298b1105a;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): properly remove comma of multiple macros in the same declaration (#7423) closes #7422 reverts #6778 --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index c8bdb1573e..99f3395915 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -754,6 +754,24 @@ return { a, props, emit } }" `; +exports[`SFC compile + `) + assertCode(content) + expect(content).toMatch(`props: ['item'],`) + expect(content).toMatch(`emits: ['foo'],`) + expect(content).toMatch(`const a = 0,`) + expect(content).toMatch(`b = 0;`) + }) + test('defineProps/defineEmits in multi-variable declaration (full removal)', () => { const { content } = compile(`