Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setImmediate incompatibility with IE10 even when process and process.nextTick are defined #350

Merged
merged 1 commit into from
Jan 23, 2014

Conversation

louischatriot
Copy link
Contributor

Hello,

This references issue #299 . The fix sent by @dougwilson (PR #317) only works if process or process.nextTick are not defined. This effectively assumes that in a browser context, process.nextTick is not defined, but that's not always the case. For example, if you use browserify to create a browser version of your code, process.nextTick can be defined and in that case IE10 raises the "Invalid calling object" error. That is the case with one of my projects (the javascript database NeDB, https://github.com/louischatriot/nedb).

So I just copy-pasted @dougwilson's fix in the right section and the issue is solved.

Cheers,
Louis

@dougwilson
Copy link
Contributor

I suppose the function wrap would be needed in both places since there are things like browserify that either do not add setImmediate to the global, or that do not "fix" setImmediate to act like it does in Node.js (i.e. doesn't require it to be called as a method on the global).

@selfcontained
Copy link

👍 to this

@lukekarrys
Copy link

👍 I'm currently using my fork https://github.com/lukekarrys/async in a current project to get around this bug.

@KylePDavis
Copy link

+1

caolan pushed a commit that referenced this pull request Jan 23, 2014
Fix setImmediate incompatibility with IE10 even when process and process.nextTick are defined
@caolan caolan merged commit a069df4 into caolan:master Jan 23, 2014
@diversario
Copy link

No, nothing overrides setImmediate anywhere in my code. Perhaps some modules I uses (sinon?..).

@dougwilson
Copy link
Contributor

sinon overrides setImmediate, setTimeout, etc. if you use the fake timers feature. You can find various issues in the Sinon tracker: https://github.com/cjohansen/Sinon.JS/issues?q=setimmediate

@dougwilson
Copy link
Contributor

@diversario , also, see sinonjs/sinon#561

@diversario
Copy link

Thanks, @dougwilson, that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants