Closed
Description
When a watched object's property has a NaN value and is then set again to NaN, the watch callback is incorrectly triggered. In my application this results in an infinite loop (the watch callback does some calculations on the object, which sets the NaN back to NaN).
The issue is with the reactive setter comparison of old and new value, since one of the many JS quirks is that NaN === NaN is always false. changing
if (newVal === value) {
to
if (newVal === value || newVal !== newVal && value !== value) { // accounts for NaN quirks
solves the issue.
Metadata
Metadata
Assignees
Labels
No labels