test: fix this scope bug in test-stream2-writable.js
PR-URL: https://github.com/nodejs/node/pull/27111 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
parent
0a25ace9c3
commit
93df085386
@ -322,13 +322,14 @@ for (let i = 0; i < chunks.length; i++) {
|
||||
assert.strictEqual(this.writing, undefined);
|
||||
wrote = true;
|
||||
this.writing = true;
|
||||
setTimeout(function() {
|
||||
setTimeout(() => {
|
||||
this.writing = false;
|
||||
cb();
|
||||
}, 1);
|
||||
};
|
||||
w.on('finish', common.mustCall(function() {
|
||||
assert.strictEqual(wrote, true);
|
||||
assert.strictEqual(this.writing, false);
|
||||
}));
|
||||
w.write(Buffer.alloc(0));
|
||||
w.end();
|
||||
|
Loading…
x
Reference in New Issue
Block a user