Skip to content

Commit 8c1e562

Browse files
justinbeatyfballiano
authored andcommitted
add note about fix-defer.js
1 parent 0d79919 commit 8c1e562

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

js/extjs/fix-defer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
1818
*/
1919

20+
/*
21+
* Both ExtJS and PrototypeJS write to Function.prototype.defer
22+
* However, PrototypeJS has a default delay of 0.01s if no first argument is provided
23+
* Ref: https://github.com/prototypejs/prototype/blob/1.7.3/src/prototype/lang/function.js#L292-L295
24+
* While ExtJS executes the function immediately. Presumably this causes an error for
25+
* PrototypeJS Ajax calls.
26+
*
27+
*/
28+
2029
(function(){
2130
var eDefer = Function.prototype.defer;
2231
Function.prototype.defer = function() {
@@ -28,4 +37,4 @@
2837

2938
return eDefer.apply(this, arguments);
3039
}
31-
})();
40+
})();

0 commit comments

Comments
 (0)