-
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); }; }(); },
-
19 Dec 2011 6:44 AM #2
-
19 Dec 2011 1:05 PM #3
Thanks for the report, as @LesJ said, this has been fixed for 4.1.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
5 Mar 2012 7:39 AM #4
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote