Fix unhandled promise rejection when calling read on Windows.

Without this change, following error is signaled:
(node:12996) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: First argument must be an int
This commit is contained in:
enami tsugutomo 2017-01-19 09:50:48 +09:00 • committed by Francis Gulotta
parent db88509f4f
commit 0b2a5e30df

View file

@ -36,7 +36,7 @@ class WindowsBinding extends BaseBinding {
read(buffer, offset, length) {
return super.read(buffer, offset, length)
.then(() => promisify(binding.read)(buffer, offset, length));
.then(() => promisify(binding.read)(this.fd, buffer, offset, length));
}
write(buffer) {