forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: nodejs#831 Fixes: nodejs#947 Ref: nodejs#9470 PR-URL: nodejs#9744 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
- Loading branch information
Showing
4 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const { Console } = require('console'); | ||
const { Writable } = require('stream'); | ||
const assert = require('assert'); | ||
|
||
const out = new Writable({ | ||
write: common.mustCall((chunk, enc, callback) => { | ||
process.nextTick(callback, new Error('foobar')); | ||
}) | ||
}); | ||
|
||
const c = new Console(out, out, true); | ||
|
||
assert.doesNotThrow(() => { | ||
c.log('abc'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const { Console } = require('console'); | ||
const { Writable } = require('stream'); | ||
const assert = require('assert'); | ||
|
||
{ | ||
const out = new Writable({ | ||
write: common.mustCall((chunk, enc, callback) => { | ||
callback(new Error('foobar')); | ||
}) | ||
}); | ||
|
||
const c = new Console(out, out, true); | ||
|
||
assert.doesNotThrow(() => { | ||
c.log('abc'); | ||
}); | ||
} | ||
|
||
{ | ||
const out = new Writable({ | ||
write: common.mustCall((chunk, enc, callback) => { | ||
throw new Error('foobar'); | ||
}) | ||
}); | ||
|
||
const c = new Console(out, out, true); | ||
|
||
assert.doesNotThrow(() => { | ||
c.log('abc'); | ||
}); | ||
} | ||
|
||
{ | ||
const out = new Writable({ | ||
write: common.mustCall((chunk, enc, callback) => { | ||
setImmediate(() => callback(new Error('foobar'))); | ||
}) | ||
}); | ||
|
||
const c = new Console(out, out, true); | ||
|
||
assert.doesNotThrow(() => { | ||
c.log('abc'); | ||
}); | ||
} |
File renamed without changes.