From 2e58e088b09642acf9e4b7f08f89cfc2218985a8 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 23 Dec 2024 13:56:37 +0900 Subject: [PATCH] fix(ext/fs): do not throw for bigint ctime/mtime/atime (#27453) --- ext/fs/30_fs.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index fc2b18be13..4e71acb1b2 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -77,6 +77,7 @@ const { Error, Function, MathTrunc, + Number, ObjectEntries, ObjectDefineProperty, ObjectPrototypeIsPrototypeOf, @@ -373,12 +374,12 @@ function parseFileInfo(response) { isDirectory: response.isDirectory, isSymlink: response.isSymlink, size: response.size, - mtime: response.mtimeSet === true ? new Date(response.mtime) : null, - atime: response.atimeSet === true ? new Date(response.atime) : null, + mtime: response.mtimeSet === true ? new Date(Number(response.mtime)) : null, + atime: response.atimeSet === true ? new Date(Number(response.atime)) : null, birthtime: response.birthtimeSet === true ? new Date(response.birthtime) : null, - ctime: response.ctimeSet === true ? new Date(response.ctime) : null, + ctime: response.ctimeSet === true ? new Date(Number(response.ctime)) : null, dev: response.dev, mode: response.mode, ino: unix ? response.ino : null,