We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c377053 commit e087f26Copy full SHA for e087f26
test/parallel/test-child-process-flush-stdio.js
@@ -9,25 +9,25 @@ const opts = { shell: common.isWindows };
9
10
const p = cp.spawn('echo', [], opts);
11
12
-p.on('close', common.mustCall(function(code, signal) {
+p.on('close', common.mustCall((code, signal) => {
13
assert.strictEqual(code, 0);
14
assert.strictEqual(signal, null);
15
spawnWithReadable();
16
}));
17
18
p.stdout.read();
19
20
-function spawnWithReadable() {
+const spawnWithReadable = () => {
21
const buffer = [];
22
const p = cp.spawn('echo', ['123'], opts);
23
- p.on('close', common.mustCall(function(code, signal) {
+ p.on('close', common.mustCall((code, signal) => {
24
25
26
assert.strictEqual(Buffer.concat(buffer).toString().trim(), '123');
27
28
- p.stdout.on('readable', function() {
+ p.stdout.on('readable', () => {
29
let buf;
30
- while (buf = this.read())
+ while (buf = p.stdout.read())
31
buffer.push(buf);
32
});
33
-}
+};
0 commit comments