dijit/_WidgetBase#_set incorrectly calls watchers when oldValue and value are both NaN
Because NaN !== NaN
is true in JavaScript?, watchers will be fired always in the scenario that oldValue
is NaN and value
is also NaN.
A (the?) fix is to change if(this._created && value !== oldValue){
to if(this._created && value !== oldValue && !isNaN(value) && !isNaN(oldValue)){
in _WidgetBase#_set
.
(This is a particular problem for widgets like NumberTextBox? which use NaN regularly.)
Yay JavaScript?!
Change History (10)
Description: |
modified (diff)
|
Owner: |
set to bill
|
Status: |
new →
assigned
|
Milestone: |
tbd →
1.9.2
|
Priority: |
high →
blocker
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
Actually as bill pointed out to me, the above code is not correct because isNaN('foo') is true. The correct thing would be like: