fix(reactivity): ensure add/set on reactive collections return the proxy (#2534)

fix #2530
This commit is contained in:
Thorsten Lünborg
2020-11-27 20:16:00 +01:00
committed by GitHub
parent 0ff2a4f1c1
commit 6e46a574ed
5 changed files with 27 additions and 4 deletions

View File

@@ -99,5 +99,11 @@ describe('reactivity/collections', () => {
expect(observed.has(value)).toBe(true)
expect(set.has(value)).toBe(false)
})
it('should return proxy from WeakSet.add call', () => {
const set = reactive(new WeakSet())
const result = set.add({})
expect(result).toBe(set)
})
})
})