summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Bruno <lucab@lucabruno.net>2023-06-23 08:07:03 +0200
committerGitHub <noreply@github.com>2023-06-23 08:07:03 +0200
commit76f85a783e3ba4064027f581eb1fecf2ecba9de0 (patch)
treecc22faa46baa397a14a7530f4bcefd5da11a8a98
parentdda0f1c343bfb3196ce6a7c7e8c2acccfd5c2e5b (diff)
fix(ext/fs): fix boolean checks in JS parser (#19586)
This fixes a bug in file metadata parsing logic, which now properly evaluates boolean fields when forwarding for atime / mtime / birthtime values. Ref: https://github.com/denoland/deploy_feedback/issues/409
-rw-r--r--ext/fs/30_fs.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js
index a149f653d..9c3bee6ac 100644
--- a/ext/fs/30_fs.js
+++ b/ext/fs/30_fs.js
@@ -316,9 +316,9 @@ function parseFileInfo(response) {
isDirectory: response.isDirectory,
isSymlink: response.isSymlink,
size: response.size,
- mtime: response.mtimeSet !== null ? new Date(response.mtime) : null,
- atime: response.atimeSet !== null ? new Date(response.atime) : null,
- birthtime: response.birthtimeSet !== null
+ mtime: response.mtimeSet === true ? new Date(response.mtime) : null,
+ atime: response.atimeSet === true ? new Date(response.atime) : null,
+ birthtime: response.birthtimeSet === true
? new Date(response.birthtime)
: null,
dev: response.dev,