From e3d634eb218f48b7152b40d64b07ff2f0a58ca09 Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Mon, 17 Sep 2018 16:53:55 -0700 Subject: Make mode always u32 and switch to has_mode for StatRes fbs (#761) --- js/stat.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/stat.ts b/js/stat.ts index 293d3aa69..a3ae553da 100644 --- a/js/stat.ts +++ b/js/stat.ts @@ -70,6 +70,7 @@ class FileInfoImpl implements FileInfo { const modified = this._msg.modified().toFloat64(); const accessed = this._msg.accessed().toFloat64(); const created = this._msg.created().toFloat64(); + const hasMode = this._msg.hasMode(); const mode = this._msg.mode(); // negative for invalid mode (Windows) this._isFile = this._msg.isFile(); @@ -78,8 +79,8 @@ class FileInfoImpl implements FileInfo { this.modified = modified ? modified : null; this.accessed = accessed ? accessed : null; this.created = created ? created : null; - // null if invalid mode (Windows) - this.mode = mode >= 0 ? mode & 0o7777 : null; + // null on Windows + this.mode = hasMode ? mode : null; } isFile() { -- cgit v1.2.3