REQUIRED INFORMATION

Ext version tested:
  • Ext 4.*

Description:
Ext.Function.createInterceptor can't return false value for intercepted method. Because of this compare with false thru === is failed

Steps to reproduce the problem:
Execute code from test case.

The result that was expected:
Code:
f0
hello
f0Interceptor
hello
The result that occurs instead:
Code:
f0
hello
f0Interceptor
Test Case:
PHP Code:
var hello = function() {
    
console.log('hello');
},
f0 = function() {
    
console.log('f0');
    return 
false;
};
if (
f0() === false) {
    
hello();
}

f0 Ext.Function.createInterceptor(f0, function() {
    
console.log('f0Interceptor');
    return 
false;
}, 
thisfalse);

if (
f0() === false) {
    
hello();
} else {
    throw new 
Error("Interceptor fail");


HELPFUL INFORMATION

Possible fix:
PHP Code:
Ext.apply(Ext.Function, {
    
createInterceptor: function(origFnnewFnscopereturnValue) {
        var 
method origFn;
        if (!
Ext.isFunction(newFn)) {
            return 
origFn;
        } else {
            
returnValue Ext.isDefined(returnValue) ? returnValue null
            return function() {
                var 
me this,
                    
args arguments;
                
newFn.target me;
                
newFn.method origFn;
                return (
newFn.apply(scope || me || Ext.global, args) !== false) ? origFn.apply(me || Ext.global, args) : returnValue;
            };
        }
    }
});