diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-06-18 16:33:03 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-18 16:33:03 +0530 |
commit | 10ac3bb091e4060053298540225f0005d9d2bfdb (patch) | |
tree | a4eaf998b744d230b0eeca6208eacb9ff8e5e415 | |
parent | 8c4b33db0d05181a0e5538bddaf063144724c938 (diff) |
fix(ext/node): make process.versions own property (#24240)
-rw-r--r-- | ext/node/polyfills/process.ts | 3 | ||||
-rw-r--r-- | tests/unit_node/process_test.ts | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index a001d2e0f..bec62122b 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -731,6 +731,9 @@ if (isWindows) { // @ts-ignore TS doesn't work well with ES5 classes const process = new Process(); +/* Set owned property */ +process.versions = versions; + Object.defineProperty(process, Symbol.toStringTag, { enumerable: false, writable: true, diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 24fd3909d..e15d37744 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -1116,3 +1116,7 @@ Deno.test("process.listeners - include SIG* events", () => { process.off("SIGINT", listener2); assertEquals(process.listeners("SIGINT").length, 0); }); + +Deno.test(function processVersionsOwnProperty() { + assert(Object.prototype.hasOwnProperty.call(process, "versions")); +}); |