From fb86820e4e2ed2b43a49591864fee461e85ed162 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 21 Jul 2017 10:50:19 -0400 Subject: [PATCH] Lift arguments object reference up to origin scope See explanation: https://github.com/EmergingTechnologyAdvisors/node-serialport/issues/1245 Signed-off-by: Rick Waldron --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index c1f8188..d246a6d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -5,8 +5,8 @@ function promisify(func) { throw new Error('"func" must be a function'); } return function() { + const args = Array.from(arguments); return new Promise((resolve, reject) => { - const args = Array.prototype.slice.apply(arguments); args.push((err, data) => { if (err) { return reject(err);