expect(isReactive(obj.bar)).toBe(false)
})
- test('should not observe frozen objects', () => {
+ test('should not observe non-extensible objects', () => {
const obj = reactive({
- foo: Object.freeze({ a: 1 })
+ foo: Object.preventExtensions({ a: 1 }),
+ // sealed or frozen objects are considered non-extensible as well
+ bar: Object.freeze({ a: 1 }),
+ baz: Object.seal({ a: 1 })
})
expect(isReactive(obj.foo)).toBe(false)
+ expect(isReactive(obj.bar)).toBe(false)
+ expect(isReactive(obj.baz)).toBe(false)
})
test('should not observe objects with __v_skip', () => {