summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Christopher Wilson <doug@somethingdoug.com>2013-05-21 00:04:25 -0400
committerDouglas Christopher Wilson <doug@somethingdoug.com>2013-05-21 00:04:25 -0400
commitb6a1336bcb0865d6d26224f9553b9e1886fe696e (patch)
treef0cb28f3341a36ec67f6750a88923467dfa63514 /lib
parentebec545152d6623f81922405006d1957c1d3de97 (diff)
downloadasync-b6a1336bcb0865d6d26224f9553b9e1886fe696e.tar.gz
Fix async compatibility with Internet Explorer 10
This fixes async to work on Internet Explorer 10. Internet Explorer 10 requires that the `setImmediate` function is not called as a method. As such, it cannot simply be aliased as `async.setImmediate` and `async.nextTick` as `Invalid calling object` error will be encountered since `setImmediate` will be called with `this` set to `async`.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/async.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/async.js b/lib/async.js
index 46f4f50..cb6320d 100755
--- a/lib/async.js
+++ b/lib/async.js
@@ -75,8 +75,11 @@
//// nextTick implementation with browser-compatible fallback ////
if (typeof process === 'undefined' || !(process.nextTick)) {
if (typeof setImmediate === 'function') {
- async.setImmediate = setImmediate;
- async.nextTick = setImmediate;
+ async.nextTick = function (fn) {
+ // not a direct alias for IE10 compatibility
+ setImmediate(fn);
+ };
+ async.setImmediate = async.nextTick;
}
else {
async.nextTick = function (fn) {