Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
Testing for v===undefined is unsafe in IE as undefined is mutable in IE
IE allows undefined to be changed, so comparing to undefined is not gauranteed to be correct in IE.
Testing typeof v !== 'undefined' will always give the correct result.
Ext.isDefined(v){...} uses typeof v !== 'undefined'
Ext.isEmpty(v, allowBlank){...} uses v===undefined
Chrome does not allow undefined to be changed so both functions always return the correct result in Chrome; however, IE allows undefined to be changed (IE should not allow this, but it does).
//TEST CODE:
var t0="dishwasher"
if(undefined="dishwasher"){
//an incorrectly writtten IF corrupts undefined
}
var t1="dishwasher";
var t2;
console.log("t1 isDefined:"+ Ext.isDefined(t1));
console.log("t1 isEmpty: "+ Ext.isEmpty(t1));
console.log("t2 isDefined:"+ Ext.isDefined(t2));
console.log("t2 isEmpty: "+ Ext.isEmpty(t2));
IE RESULTS:
t1 isDefined:true <<< this is correct
t1 isEmpty: true <<< this is wrong!!! it is not empty, it contains 'dishwasher'
t2 isDefined:false <<<this is correct
t2 isEmpty: false <<<this is wrong!!! if t2 is undefined then isEmpty() should return true!!!
CHROME RESULTS:
t1 isDefined:true
t1 isEmpty: false
t2 isDefined:false
t2 isEmpty: true
Please consider changing isEmpty() to use isDefined() or to use typeof like isDefined() does and review all EXT code for use of v===undefined which is unsafe test in IE.
-
I have offered your suggestion for consideration: EXTJSIII-53
Regards,
Scott.