Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fixes setImmediate is undefined error for gecko/webkit browsers #269

Merged
merged 1 commit into from

8 participants

@tborg

Hi there,

Ran into this problem using in Chrome: the source was defining async.setImmediate as async.nextTick before async.nextTick's definition, causing async.waterfall to fail for me, so I simply swapped the order.

Thanks for the great lib, I appreciate it.

@edjafarov

Yep I got same problem :(

@jbpros

I closed my duplicate PR and :+1: this one instead :)

@pchoi

@caolan I would appreciate it if you can merge this fix in. Thanks!

@prust

@caolan: it's a bit embarrassing that async has been broken in Chrome, Firefox & Safari for a month. IMO, it's one of the most useful JS libraries in existence, both for node and the browser. Let me know if it would help if I rebased this pull request on the latest master or if I tested the fix on different versions of node and/or browsers.

In case it helps, here's what the mozilla docs say about setImmediate():

setImmediate() is not expected to become standard, and is only implemented by recent builds of Internet Explorer. It meets resistance both from Gecko (Firefox) and Webkit (Google/Apple)

@caseywebdev

Another :+1:, this is obviously just an assignment ordering error with a very simple fix.

@caolan caolan merged commit 9ac2b2f into caolan:master
@caolan
Owner

Sorry folks, didn't notice this since I seem to have stopped getting emails from GitHub. Thankfully @brianmaissy, thought to email me about it.

@prust

thanks @caolan, much appreciated. Hope the GH email issue gets sorted.

@tborg
@mikermcneil

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/async.js
View
2  lib/async.js
@@ -79,10 +79,10 @@
async.nextTick = setImmediate;
}
else {
- async.setImmediate = async.nextTick;
async.nextTick = function (fn) {
setTimeout(fn, 0);
};
+ async.setImmediate = async.nextTick;
}
}
else {
Something went wrong with that request. Please try again.