Skip to content

Commit 93df085

Browse files
gengjiawenZYSzys
authored andcommitted
test: fix this scope bug in test-stream2-writable.js
PR-URL: #27111 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 0a25ace commit 93df085

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-stream2-writable.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,14 @@ for (let i = 0; i < chunks.length; i++) {
322322
assert.strictEqual(this.writing, undefined);
323323
wrote = true;
324324
this.writing = true;
325-
setTimeout(function() {
325+
setTimeout(() => {
326326
this.writing = false;
327327
cb();
328328
}, 1);
329329
};
330330
w.on('finish', common.mustCall(function() {
331331
assert.strictEqual(wrote, true);
332+
assert.strictEqual(this.writing, false);
332333
}));
333334
w.write(Buffer.alloc(0));
334335
w.end();

0 commit comments

Comments
 (0)