Threaded View
-
19 Dec 2011 5:07 AM #1
Ext.Function.createBuffered ignoring arguments
Ext.Function.createBuffered ignoring arguments
ExtJS 4.0.7, Firefox 7.0.1.
Ext.Function.createBuffered function ignores arguments passed to buffered function.
Example:
Expected:Code:fun = function() { console.log(arguments); } fun2 = Ext.Function.createBuffered(fun, 100); fun2(1, 2, 3);
Got:Code:[1, 2, 3]
Code:[ -12 ]
Code:createBuffered: function(fn, buffer, scope, args) { return function(){ var timerId; return function() { var me = this; if (timerId) { clearTimeout(timerId); timerId = null; } var args2 = arguments; timerId = setTimeout(function(){ //fn.apply(scope || me, args || arguments); //WRONG fn.apply(scope || me, args || args2); //CORRECT }, buffer); }; }(); },
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote