Thread: replace call to setImmediate
setImmediate is a Node.js function with no browser support, resulting in a runtime error when viewing threads. It is roughly equivalent to setTimeout with 0.
I couldn't figure out how to make it give a type error, so I just replaced it.