fix: do not memoize Deno.ppid (#23006)

Fixes https://github.com/denoland/deno/issues/23004
This commit is contained in:
Divy Srivastava 2024-03-21 08:24:33 +05:30 committed by GitHub
parent e45f433a16
commit 2f7b9660fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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()),