From 2f7b9660fa2316ec6301c9c72cc2cfa12c361cf4 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 21 Mar 2024 08:24:33 +0530 Subject: [PATCH] fix: do not memoize `Deno.ppid` (#23006) Fixes https://github.com/denoland/deno/issues/23004 --- runtime/js/99_main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index e97eed9ff9..1a1f781190 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -370,7 +370,6 @@ function importScripts(...urls) { const opArgs = memoizeLazy(() => op_bootstrap_args()); const opPid = memoizeLazy(() => op_bootstrap_pid()); -const opPpid = memoizeLazy(() => op_ppid()); setNoColorFn(() => op_bootstrap_no_color() || !op_bootstrap_is_tty()); function formatException(error) { @@ -716,7 +715,9 @@ function bootstrapMainRuntime(runtimeOptions) { ObjectDefineProperties(finalDenoNs, { pid: core.propGetterOnly(opPid), - ppid: core.propGetterOnly(opPpid), + // `ppid` should not be memoized. + // https://github.com/denoland/deno/issues/23004 + ppid: core.propGetterOnly(() => op_ppid()), noColor: core.propGetterOnly(() => op_bootstrap_no_color()), args: core.propGetterOnly(opArgs), mainModule: core.propGetterOnly(() => op_main_module()),