Commit 2a1f094
Make
The underlying implementation in `node/lib/internal/child_process.js` does
return a boolean value, but this value is devoid of any semantic content.
Shortened it does:
```
if childProcessHandle {
res = child.kill(signal)
if (res === 0) {
child.killed = true;
return true;
else {
throwError()
}
}
else {
return false;
}
```
which means the returned boolean depends on whether the subprocess still exists
and whether the signal was successfully sent (apparently the original author
thought that sending a signal will always kill the process).
The return value isn’t even mentioned in the documentation, so it must be a
historical artifact kept around for backward compatibility.kill return Unit instead of Boolean1 parent 32f1a0c commit 2a1f094
1 file changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
| |||
0 commit comments