Skip to content

Commit

Permalink
fix(ext/node): make process.versions own property (denoland#24240)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Jun 18, 2024
1 parent 8c4b33d commit 10ac3bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/node/polyfills/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions tests/unit_node/process_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
});

0 comments on commit 10ac3bb

Please sign in to comment.