nextTick shim for nodejs and browser