Skip to content

Commit 7c1ac6b

Browse files
committed
fix(compiler-sfc): fix setup result binding of primitive (non inlined mode)
1 parent d454b40 commit 7c1ac6b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/compiler-sfc/__tests__/__snapshots__/compileScriptRefTransform.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
let c = () => {}
1616
let d
1717
18-
return { foo, a, b, c, d, ref, shallowRef }
18+
return { get foo(){return foo}, set foo(v){foo=v}, get a(){return a}, set a(v){a=v}, get b(){return b}, set b(v){b=v}, get c(){return c}, set c(v){c=v}, get d(){return d}, set d(v){d=v}, get ref(){return ref}, get shallowRef(){return shallowRef} }
1919
}
2020
2121
}"

packages/compiler-sfc/__tests__/compileScriptRefTransform.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('sfc ref transform', () => {
3232
// normal declarations left untouched
3333
expect(content).toMatch(`let c = () => {}`)
3434
expect(content).toMatch(`let d`)
35-
expect(content).toMatch(`return { foo, a, b, c, d, ref, shallowRef }`)
35+
expect(content).toMatch(`return { get foo(){return foo}, set foo(v){foo=v}, get a(){return a}, set a(v){a=v}, get b(){return b}, set b(v){b=v}, get c(){return c}, set c(v){c=v}, get d(){return d}, set d(v){d=v}, get ref(){return ref}, get shallowRef(){return shallowRef} }`)
3636
assertCode(content)
3737
expect(bindings).toStrictEqual({
3838
foo: BindingTypes.SETUP_REF,

0 commit comments

Comments
 (0)