From 37524307fe2025659f2172bf72cf4d7365b8b911 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 7 May 2020 20:19:08 +0200 Subject: [PATCH] repl: remove deprecated .rli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .rli property is just a reference to the active REPL instance and it was deprecated for a long time. To improve maintainability of the REPL this feature is removed. Signed-off-by: Ruben Bridgewater PR-URL: https://github.com/nodejs/node/pull/33286 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- doc/api/deprecations.md | 5 ++++- lib/repl.js | 10 ---------- test/parallel/test-repl-options.js | 16 ---------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index cdfe2a63b03089..181ca24e29fe16 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2385,12 +2385,15 @@ Setting the TLS ServerName to an IP address is not permitted by ### DEP0124: using `REPLServer.rli` -Type: Runtime +Type: End-of-Life This property is a reference to the instance itself. diff --git a/lib/repl.js b/lib/repl.js index 65f86cb2c17a25..271640c6a715c1 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -299,16 +299,6 @@ function REPLServer(prompt, domainSet.add(this._domain); - let rli = this; - ObjectDefineProperty(this, 'rli', { - get: deprecate(() => rli, - 'REPLServer.rli is deprecated', 'DEP0124'), - set: deprecate((val) => rli = val, - 'REPLServer.rli is deprecated', 'DEP0124'), - enumerable: true, - configurable: true - }); - const savedRegExMatches = ['', '', '', '', '', '', '', '', '', '']; const sep = '\u0000\u0000\u0000'; const regExMatcher = new RegExp(`^${sep}(.*)${sep}(.*)${sep}(.*)${sep}(.*)` + diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index cb7b2f08b65468..3f6e16ee47fba2 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -37,7 +37,6 @@ common.expectWarning({ 'repl._builtinLibs is deprecated. Check module.builtinModules instead', DEP0141: 'repl.inputStream and repl.outputStream is deprecated. ' + 'Use repl.input and repl.output instead', - DEP0124: 'REPLServer.rli is deprecated', } }); @@ -62,14 +61,6 @@ assert.strictEqual(r1.ignoreUndefined, false); assert.strictEqual(r1.replMode, repl.REPL_MODE_SLOPPY); assert.strictEqual(r1.historySize, 30); -// Test r1 for backwards compact -assert.strictEqual(r1.rli.input, stream); -assert.strictEqual(r1.rli.output, stream); -assert.strictEqual(r1.rli.input, r1.inputStream); -assert.strictEqual(r1.rli.output, r1.outputStream); -assert.strictEqual(r1.rli.terminal, true); -assert.strictEqual(r1.useColors, r1.rli.terminal); - // 2 function writer() {} @@ -98,13 +89,6 @@ assert.strictEqual(r2.writer, writer); assert.strictEqual(r2.replMode, repl.REPL_MODE_STRICT); assert.strictEqual(r2.historySize, 50); -// Test r2 for backwards compact -assert.strictEqual(r2.rli.input, stream); -assert.strictEqual(r2.rli.output, stream); -assert.strictEqual(r2.rli.input, r2.inputStream); -assert.strictEqual(r2.rli.output, r2.outputStream); -assert.strictEqual(r2.rli.terminal, false); - // 3, breakEvalOnSigint and eval supplied together should cause a throw const r3 = () => repl.start({ breakEvalOnSigint: true,