mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 09:08:46 +00:00

In a continuing effort to de-monolithize `require('../common')`, move `common.ArrayStream` out to a separate module that is imported only when it is needed. PR-URL: https://github.com/nodejs/node/pull/22447 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
24 lines
678 B
JavaScript
24 lines
678 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const ArrayStream = require('../common/arraystream');
|
|
const repl = require('repl');
|
|
const DEFAULT_MAX_LISTENERS = require('events').defaultMaxListeners;
|
|
|
|
ArrayStream.prototype.write = () => {
|
|
};
|
|
|
|
const putIn = new ArrayStream();
|
|
const testMe = repl.start('', putIn);
|
|
|
|
// https://github.com/nodejs/node/issues/18284
|
|
// Tab-completion should not repeatedly add the
|
|
// `Runtime.executionContextCreated` listener
|
|
process.on('warning', common.mustNotCall());
|
|
|
|
putIn.run(['.clear']);
|
|
putIn.run(['async function test() {']);
|
|
for (let i = 0; i < DEFAULT_MAX_LISTENERS; i++) {
|
|
testMe.complete('await Promise.resolve()', () => {});
|
|
}
|