Lift arguments object reference up to origin scope

See explanation: https://github.com/EmergingTechnologyAdvisors/node-serialport/issues/1245

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
Rick Waldron 2017-07-21 10:50:19 -04:00
parent 468dfc29d7
commit fb86820e4e

View file

@ -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);