mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1006 B
29 lines
1006 B
'use strict';
|
|
const common = require('../common');
|
|
|
|
const originalRefreshSizeStderr = process.stderr._refreshSize;
|
|
const originalRefreshSizeStdout = process.stdout._refreshSize;
|
|
|
|
const wrap = (fn, ioStream, string) => {
|
|
return () => {
|
|
// The console.log() call prints a string that is in the .out file. In other
|
|
// words, the console.log() is part of the test, not extraneous debugging.
|
|
console.log(string);
|
|
try {
|
|
fn.call(ioStream);
|
|
} catch (e) {
|
|
// EINVAL happens on SmartOS if emulation is incomplete
|
|
if (!common.isSunOS || e.code !== 'EINVAL')
|
|
throw e;
|
|
}
|
|
};
|
|
};
|
|
|
|
process.stderr._refreshSize = wrap(originalRefreshSizeStderr,
|
|
process.stderr,
|
|
'calling stderr._refreshSize');
|
|
process.stdout._refreshSize = wrap(originalRefreshSizeStdout,
|
|
process.stdout,
|
|
'calling stdout._refreshSize');
|
|
|
|
process.emit('SIGWINCH');
|
|
|