Skip to content

Commit

Permalink
repl: remove deprecated .rli
Browse files Browse the repository at this point in the history
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 <ruben@bridgewater.de>

PR-URL: #33286
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
BridgeAR committed May 23, 2020
1 parent e88d098 commit 3752430
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Expand Up @@ -2385,12 +2385,15 @@ Setting the TLS ServerName to an IP address is not permitted by
### DEP0124: using `REPLServer.rli`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/33286
description: End-of-Life.
- version: v12.0.0
pr-url: https://github.com/nodejs/node/pull/26260
description: Runtime deprecation.
-->
Type: Runtime
Type: End-of-Life
This property is a reference to the instance itself.
Expand Down
10 changes: 0 additions & 10 deletions lib/repl.js
Expand Up @@ -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}(.*)` +
Expand Down
16 changes: 0 additions & 16 deletions test/parallel/test-repl-options.js
Expand Up @@ -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',
}
});

Expand All @@ -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() {}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3752430

Please sign in to comment.