mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
d49661bb80
Fixes test/parallel/test-console-no-swallow-stack-exceeded.js PR-URL: https://github.com/nodejs/node/pull/19423 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
19 lines
483 B
JavaScript
19 lines
483 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const { Console } = require('console');
|
|
const { Writable } = require('stream');
|
|
|
|
for (const method of ['dir', 'log', 'warn']) {
|
|
common.expectsError(() => {
|
|
const out = new Writable({
|
|
write: common.mustCall(function write(...args) {
|
|
// Exceeds call stack.
|
|
return write(...args);
|
|
}),
|
|
});
|
|
const c = new Console(out, out, true);
|
|
|
|
c[method]('Hello, world!');
|
|
}, { name: 'RangeError' });
|
|
}
|