From 5ec54f8ca9f02034b4cea7a5b13706c85e84ecc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20C=C3=B4t=C3=A9?= Date: Tue, 10 May 2022 13:59:06 -0400 Subject: [PATCH] Replace setImmediate(fn) by setTimeout(fn, 0) --- src/chrome-apps-serialport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chrome-apps-serialport.js b/src/chrome-apps-serialport.js index 04a8f72..8e3e5fe 100644 --- a/src/chrome-apps-serialport.js +++ b/src/chrome-apps-serialport.js @@ -298,7 +298,7 @@ SerialPort.prototype._processBuffer = function (buffer, callback) { } this.sending = false; - if (this._sendBufferArray.length > 0) setImmediate(this._processBuffer.bind(this)); + if (this._sendBufferArray.length > 0) setTimeout(this._processBuffer.bind(this), 0); }.bind(this));