diff --git a/src/node.js b/src/node.js index c8f55c6b07..b0a524c3e0 100644 --- a/src/node.js +++ b/src/node.js @@ -536,21 +536,25 @@ var posixModule = createInternalModule("posix", function (exports) { exports.read = function (fd, length, position, encoding) { var promise = new process.Promise() + encoding = encoding || "binary"; process.fs.read(fd, length, position, encoding, callback(promise)); return promise; }; exports.readSync = function (fd, length, position, encoding) { + encoding = encoding || "binary"; return process.fs.read(fd, length, position, encoding); }; exports.write = function (fd, data, position, encoding) { var promise = new process.Promise() + encoding = encoding || "binary"; process.fs.write(fd, data, position, encoding, callback(promise)); return promise; }; exports.writeSync = function (fd, data, position, encoding) { + encoding = encoding || "binary"; return process.fs.write(fd, data, position, encoding); };