You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: