1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00

fix(node): polyfill process.title (#20044)

Closes https://github.com/denoland/deno/issues/19777
This commit is contained in:
Bartek Iwańczuk 2023-08-04 14:31:13 +02:00 committed by GitHub
parent 8d8a89ceea
commit 6405b5f454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -764,3 +764,13 @@ Deno.test({
assert(typeof process.stdout.isTTY === "boolean"); assert(typeof process.stdout.isTTY === "boolean");
}, },
}); });
Deno.test({
name: "process.title",
fn() {
assertEquals(process.title, "deno");
// Verify that setting the value has no effect.
process.title = "foo";
assertEquals(process.title, "deno");
},
});

View file

@ -364,6 +364,16 @@ class Process extends EventEmitter {
return arch; return arch;
} }
get title() {
return "deno";
}
set title(_value) {
// NOTE(bartlomieju): this is a noop. Node.js doesn't guarantee that the
// process name will be properly set and visible from other tools anyway.
// Might revisit in the future.
}
/** /**
* https://nodejs.org/api/process.html#process_process_argv * https://nodejs.org/api/process.html#process_process_argv
* Read permissions are required in order to get the executable route * Read permissions are required in order to get the executable route