Skip to content

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

Closed
@catpigdog

Description

@catpigdog

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions