From 42e6441baa40de1073cea1690adc745039650e4b Mon Sep 17 00:00:00 2001 From: RedYetiDev <38299977+RedYetiDev@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:34:33 -0400 Subject: [PATCH] fixup! fixup! repl: don't use deprecated `domain` module --- doc/api/repl.md | 2 +- lib/repl.js | 1 - test/fixtures/repl-tab-completion-nested-repls.js | 8 ++++---- test/parallel/test-repl-tab-complete-nested-repls.js | 4 +--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/api/repl.md b/doc/api/repl.md index f4790ca03361ed..6b8693e74bfaa7 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -153,7 +153,7 @@ global or scoped variable, the input `fs` will be evaluated on-demand as changes: - version: REPLACEME pr-url: https://github.com/nodejs/node/pull/55204 - description: The ``process.setUncaughtExceptionCaptureCallback()` + description: The `process.setUncaughtExceptionCaptureCallback()` function is now used instead of the `domain` module. - version: v12.3.0 pr-url: https://github.com/nodejs/node/pull/27151 diff --git a/lib/repl.js b/lib/repl.js index f6871aff52cfb2..8d39bda9f2462f 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -645,7 +645,6 @@ function REPLServer(prompt, }; function handleEvaluationError(e) { - self.emit('repl_error', e); debug('eval error'); let errStack = ''; diff --git a/test/fixtures/repl-tab-completion-nested-repls.js b/test/fixtures/repl-tab-completion-nested-repls.js index f204faf714be79..61577320c31d95 100644 --- a/test/fixtures/repl-tab-completion-nested-repls.js +++ b/test/fixtures/repl-tab-completion-nested-repls.js @@ -29,11 +29,11 @@ ArrayStream.prototype.write = noop; const repl = require('repl'); const putIn = new ArrayStream(); -const testMe = repl.start('', putIn); -// Some errors are passed to the domain, but do not callback. -testMe.on('repl_error', function(err) { - throw err; +const testMe = repl.start({ + prompt: '', + input: putIn, + output: process.stdout, }); // Nesting of structures causes REPL to use a nested REPL for completion. diff --git a/test/parallel/test-repl-tab-complete-nested-repls.js b/test/parallel/test-repl-tab-complete-nested-repls.js index 3cac02f20562bc..3d090d327f4bf2 100644 --- a/test/parallel/test-repl-tab-complete-nested-repls.js +++ b/test/parallel/test-repl-tab-complete-nested-repls.js @@ -18,6 +18,4 @@ const result = spawnSync(process.execPath, [testFile]); // The spawned process will fail. In Node.js 10.11.0, it will fail silently. The // test here is to make sure that the error information bubbles up to the // calling process. -assert.ok(result.status, 'testFile swallowed its error'); -const err = result.stderr.toString(); -assert.ok(err.includes('fhqwhgads'), err); +assert.ok(result.stdout.toString().includes('fhqwhgads'));