We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf57429 commit b01f69aCopy full SHA for b01f69a
lib/XMLHttpRequest.js
@@ -636,14 +636,14 @@ function XMLHttpRequest(opts) {
636
this.dispatchEvent = function (event) {
637
if (typeof self["on" + event] === "function") {
638
if (this.readyState === this.DONE && settings.async)
639
- setImmediate(function() { self["on" + event]() })
+ setTimeout(function() { self["on" + event]() }, 0)
640
else
641
self["on" + event]()
642
}
643
if (event in listeners) {
644
for (let i = 0, len = listeners[event].length; i < len; i++) {
645
if (this.readyState === this.DONE)
646
- setImmediate(function() { listeners[event][i].call(self) })
+ setTimeout(function() { listeners[event][i].call(self) }, 0)
647
648
listeners[event][i].call(self)
649
0 commit comments