1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(ext/node): make process.versions own property (#24240)

This commit is contained in:
Divy Srivastava 2024-06-18 16:33:03 +05:30 committed by Bartek Iwańczuk
parent 573bf3c160
commit d0a7ec981c
No known key found for this signature in database
GPG key ID: 0C6BCDDC3B3AD750
2 changed files with 7 additions and 0 deletions

View file

@ -731,6 +731,9 @@ if (isWindows) {
// @ts-ignore TS doesn't work well with ES5 classes // @ts-ignore TS doesn't work well with ES5 classes
const process = new Process(); const process = new Process();
/* Set owned property */
process.versions = versions;
Object.defineProperty(process, Symbol.toStringTag, { Object.defineProperty(process, Symbol.toStringTag, {
enumerable: false, enumerable: false,
writable: true, writable: true,

View file

@ -1116,3 +1116,7 @@ Deno.test("process.listeners - include SIG* events", () => {
process.off("SIGINT", listener2); process.off("SIGINT", listener2);
assertEquals(process.listeners("SIGINT").length, 0); assertEquals(process.listeners("SIGINT").length, 0);
}); });
Deno.test(function processVersionsOwnProperty() {
assert(Object.prototype.hasOwnProperty.call(process, "versions"));
});