Commit 170cc2e
authored
refactor: check if node via process.versions (#222)
This removes the `process.title` check for node and uses `process.versions` instead, `process.title`
is not really reliable as it can be set by code, for example some CLIs will rename the process,
by using `process.versions.node` we can be more sure that we're in node, unless we're in a runtime
that stubs this.
Looking at the libuv codebase we can see that the `uv_get_process_title`[1] function has an assertion
that the title retrieved is not empty, given that we've only seen this on Windows it's possible there's
some permissions issue or similar that is causing this.
[1] https://github.com/libuv/libuv/blob/47a5c85c4e7c63adc838d8e252fb4859e6cb743d/src/win/util.c#L390-L424
Closes #2191 parent 05c790e commit 170cc2e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
0 commit comments