Skip to content
Closed

Jsarrow7 #24441

Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-alloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ assert.strictEqual((Buffer.from('Man')).toString('base64'), 'TWFu');
'dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZ' +
'GdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm' +
'5hbCBwbGVhc3VyZS4=';
assert.strictEqual(expected, (Buffer.from(quote)).toString('base64'));
assert.strictEqual((Buffer.from(quote)).toString('base64'), expected);

let b = Buffer.allocUnsafe(1024);
let bytesWritten = b.write(expected, 0, 'base64');
Expand Down
10 changes: 5 additions & 5 deletions test/parallel/test-stream-pipe-await-drain.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ const buffer = Buffer.allocUnsafe(560000);

reader._read = () => {};

writer1._write = common.mustCall(function(chunk, encoding, cb) {
writer1._write = common.mustCall((chunk, encoding, cb) => {
Comment thread
apoorvanand marked this conversation as resolved.
Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey what I have to change in it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed back to non arrow function

this.emit('chunk-received');
cb();
}, 1);

writer1.once('chunk-received', function() {
writer1.once('chunk-received', () => {
assert.strictEqual(
reader._readableState.awaitDrain,
0,
'awaitDrain initial value should be 0, actual is ' +
reader._readableState.awaitDrain
);
setImmediate(function() {
setImmediate(() => {
// This one should *not* get through to writer1 because writer2 is not
// "done" processing.
reader.push(buffer);
});
});

// A "slow" consumer:
writer2._write = common.mustCall(function(chunk, encoding, cb) {
writer2._write = common.mustCall((chunk, encoding, cb) => {
assert.strictEqual(
reader._readableState.awaitDrain,
1,
Expand All @@ -49,7 +49,7 @@ writer2._write = common.mustCall(function(chunk, encoding, cb) {
// will return false.
}, 1);

writer3._write = common.mustCall(function(chunk, encoding, cb) {
writer3._write = common.mustCall((chunk, encoding, cb) => {
assert.strictEqual(
reader._readableState.awaitDrain,
2,
Expand Down