Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(reactivity): add NaN prop on Array should not trigger length dependency #1998

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

HeftyKoo
Copy link
Contributor

Fixed:

const observed = reactive(new Array(3))
effect(() => {
  console.log(observed.length)
})
observed[NaN] = 1

@yyx990803
Copy link
Member

yyx990803 commented Sep 15, 2020

Technically NaN is not a valid index so IMO it should be treated like a non-index property. nvm, the fix is correct!

@yyx990803 yyx990803 closed this Sep 15, 2020
@yyx990803 yyx990803 reopened this Sep 15, 2020
@yyx990803 yyx990803 merged commit 0d4910a into vuejs:master Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants