mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
Currently an error is printed identical, no matter if it is just inspected or if the error is thrown inside of the REPL. This makes sure we are able to distinguish these cases. PR-URL: https://github.com/nodejs/node/pull/25253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net>
23 lines
677 B
JavaScript
23 lines
677 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()', () => {});
|
|
}
|