From 76f85a783e3ba4064027f581eb1fecf2ecba9de0 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Fri, 23 Jun 2023 08:07:03 +0200 Subject: 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 --- ext/fs/30_fs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/fs') 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, -- cgit v1.2.3