From f0a3d206422af3177e0f36ed22802c1ccc6f7654 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Fri, 6 Sep 2024 19:52:59 +0900 Subject: fix(runtime): use more null proto objects again (#25040) proceed with #23921 This PR is a preparation for https://github.com/denoland/deno_lint/pull/1307 --------- Signed-off-by: Kenta Moriuchi Co-authored-by: Luca Casonato --- ext/node/polyfills/_process/streams.mjs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext/node/polyfills/_process') diff --git a/ext/node/polyfills/_process/streams.mjs b/ext/node/polyfills/_process/streams.mjs index fa24bd155..19c1c9c18 100644 --- a/ext/node/polyfills/_process/streams.mjs +++ b/ext/node/polyfills/_process/streams.mjs @@ -65,22 +65,26 @@ export function createWritableStdioStream(writer, name, warmup = false) { stream.once("close", () => writer?.close()); ObjectDefineProperties(stream, { columns: { + __proto__: null, enumerable: true, configurable: true, get: () => writer?.isTerminal() ? Deno.consoleSize?.().columns : undefined, }, rows: { + __proto__: null, enumerable: true, configurable: true, get: () => writer?.isTerminal() ? Deno.consoleSize?.().rows : undefined, }, isTTY: { + __proto__: null, enumerable: true, configurable: true, get: () => writer?.isTerminal(), }, getWindowSize: { + __proto__: null, enumerable: true, configurable: true, value: () => @@ -203,6 +207,7 @@ export const initStdin = (warmup = false) => { stdin.on("close", () => io.stdin?.close()); stdin.fd = io.stdin ? io.STDIN_RID : -1; ObjectDefineProperty(stdin, "isTTY", { + __proto__: null, enumerable: true, configurable: true, get() { @@ -216,6 +221,7 @@ export const initStdin = (warmup = false) => { return stdin; }; ObjectDefineProperty(stdin, "isRaw", { + __proto__: null, enumerable: true, configurable: true, get() { -- cgit v1.2.3