From: 花果山大圣 <316783812@qq.com> Date: Tue, 8 Nov 2022 03:16:21 +0000 (+0800) Subject: fix(compiler-sfc): fix macro usage in multi-variable declaration (#6778) X-Git-Tag: v3.2.42~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99b6697fb44dd1094ea0bf372c1d05214ffb92a2;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): fix macro usage in multi-variable declaration (#6778) fix #6757 --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 41c0d47236..9dc932034b 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -720,6 +720,23 @@ return { props, a, emit } }" `; +exports[`SFC compile + `) + assertCode(content) + expect(content).toMatch(`const a = 1;`) // test correct removal + expect(content).toMatch(`props: ['item'],`) + expect(content).toMatch(`emits: ['a'],`) + }) + test('defineProps/defineEmits in multi-variable declaration (full removal)', () => { const { content } = compile(`