From 9e3c125666d58d53884fc49277348532a760b5db Mon Sep 17 00:00:00 2001 From: tuchg Date: Tue, 25 Oct 2022 14:30:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(reactivity-transform):=20ensure=20macro?= =?UTF-8?q?=C2=A0=20comply=20with=20the=20original=20semantic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compileScriptPropsTransform.spec.ts.snap | 9 +++--- .../compileScriptRefTransform.spec.ts.snap | 10 +++--- .../compileScriptPropsTransform.spec.ts | 6 ++-- .../compileScriptRefTransform.spec.ts | 10 +++--- .../reactivityTransform.spec.ts.snap | 32 +++++++++---------- .../__tests__/reactivityTransform.spec.ts | 20 ++++++------ .../src/reactivityTransform.ts | 16 ++++++++-- 7 files changed, 57 insertions(+), 46 deletions(-) diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScriptPropsTransform.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScriptPropsTransform.spec.ts.snap index cfde6700dba..d6cdbfc5433 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScriptPropsTransform.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScriptPropsTransform.spec.ts.snap @@ -9,11 +9,10 @@ export default { const __props_bar = _toRef(__props, 'bar') const __props_foo = _toRef(__props, 'foo') - - console.log((__props_foo)) - console.log((__props_bar)) - ({ foo: __props_foo, baz: __props_bar }) - + console.log(__props_foo) + console.log(__props_bar) + { foo: __props_foo, baz: __props_bar } + return () => {} } diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScriptRefTransform.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScriptRefTransform.spec.ts.snap index b7c81a08c86..442e170094b 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScriptRefTransform.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScriptRefTransform.spec.ts.snap @@ -7,11 +7,11 @@ export default { setup(__props, { expose }) { expose(); - let foo = (ref()) - let a = (ref(1)) - let b = (shallowRef({ + let foo = ref() + let a = ref(1) + let b = shallowRef({ count: 0 - })) + }) let c = () => {} let d @@ -65,7 +65,7 @@ exports[`sfc ref transform usage in normal