From 79d144579606e95774aedf79c2a165602be0205d Mon Sep 17 00:00:00 2001 From: Evan <96965321+0xIchigo@users.noreply.github.com> Date: Wed, 16 Aug 2023 05:28:49 -0400 Subject: fix(ext/node): allow for the reassignment of userInfo() on Windows (#20165) The goal of this PR is to address issue #20106 where a `TypeError` occurs when the variables `uid` and `gid` from `userInfo()` in `node:os` are reassigned if the user is on Windows. Both `uid` and `gid` are marked as `const` therefore producing a `TypeError` when the two are reassigned. This PR achieves that goal by marking `uid` and `gid` as `let` --- ext/node/polyfills/os.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/node/polyfills') diff --git a/ext/node/polyfills/os.ts b/ext/node/polyfills/os.ts index a874c942c..c552b5a0a 100644 --- a/ext/node/polyfills/os.ts +++ b/ext/node/polyfills/os.ts @@ -320,8 +320,8 @@ export function uptime(): number { export function userInfo( options: UserInfoOptions = { encoding: "utf-8" }, ): UserInfo { - const uid = Deno.uid(); - const gid = Deno.gid(); + let uid = Deno.uid(); + let gid = Deno.gid(); if (isWindows) { uid = -1; -- cgit v1.2.3