core icon indicating copy to clipboard operation
core copied to clipboard

When accessing the hasOwnProperty method of the array, the key cannot be tracked

Open catpigdog opened this issue 1 year ago • 5 comments

Vue version

3.3.6

Link to minimal reproduction

https://play.vuejs.org/#eNp9kVFrwjAQx7/KkZdVKFXn2IOosA0ftocpc29GRomnrWuTkFyrIv3uu7boZAwfAsn9/3f53d1JPFkblQWKoRh55VJL4JEKO5E6za1xBCdwGCtKSwxhH5NKFketppsNKoIKNs7kcMcF7qSWWhntCWLn4iOML3nBsh/CfQiDVUfqPyWCoAPjCZykBqizTYZRZrZBUyNKYj/b67kzFh0dg16HC1R8pF5jhoTtV8veSupRt8VncH4Q5jaLCfkFMEr6E0JPoy5faueVKkJBnj/epNto543mOTQsUiiT2zRDN7OUMpgUw5ay1uIsM/u3JkauwPAcVwmq73/iO3+oY1LMHXp0JUpx0Sh2W6RWni7e8cD3i5ibdZGx+4b4gTy0omZsbc+FXjP2la+hfW22mertp58eCLU/N1WD1s6q8UvBu3y50fov7iB6aPJ4JTzFrxJdXZMHOIgG0aOofgANZsmX

Steps to reproduce

const array = reactive([1, 2, 3]) watchSyncEffect(() => { console.log(array.hasOwnProperty(0)) }) delete array[0]

What is expected?

The side effect function should be executed twice // true // false

What is actually happening?

The side effect function was only executed once // true

System Info

No response

Any additional comments?

No response

catpigdog avatar Mar 04 '24 19:03 catpigdog