From 6ff803d97c8849571bb95f46ba6520150b78ccd3 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 4 Aug 2019 15:13:33 +0200 Subject: [PATCH] fs: fix (temporary) for esm package Fix to unblock CITGM. See, https://github.com/standard-things/esm/issues/821. PR-URL: https://github.com/nodejs/node/pull/28957 Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Matteo Collina Reviewed-By: Trivikram Kamat --- lib/internal/fs/utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 63f02541ae669f..ac426b55881aee 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -346,6 +346,10 @@ function Stats(dev, mode, nlink, uid, gid, rdev, blksize, Object.setPrototypeOf(Stats.prototype, StatsBase.prototype); Object.setPrototypeOf(Stats, StatsBase); +// HACK: Workaround for https://github.com/standard-things/esm/issues/821. +// TODO(ronag): Remove this as soon as `esm` publishes a fixed version. +Stats.prototype.isFile = StatsBase.prototype.isFile; + Stats.prototype._checkModeProperty = function(property) { if (isWindows && (property === S_IFIFO || property === S_IFBLK || property === S_IFSOCK)) {