• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4const ArrayStream = require('../common/arraystream');
5const repl = require('repl');
6const DEFAULT_MAX_LISTENERS = require('events').defaultMaxListeners;
7
8ArrayStream.prototype.write = () => {};
9
10const putIn = new ArrayStream();
11const testMe = repl.start('', putIn);
12
13// https://github.com/nodejs/node/issues/18284
14// Tab-completion should not repeatedly add the
15// `Runtime.executionContextCreated` listener
16process.on('warning', common.mustNotCall());
17
18putIn.run(['async function test() {']);
19for (let i = 0; i < DEFAULT_MAX_LISTENERS; i++) {
20  testMe.complete('await Promise.resolve()', () => {});
21}
22