Skip to content

Commit

Permalink
test: fix this scope bug in test-stream2-writable.js
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
gengjiawen authored and ZYSzys committed Apr 8, 2019
1 parent 0a25ace commit 93df085
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-stream2-writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 93df085

Please sign in to comment.