Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
repl: remove deprecated .rli
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>
  • Loading branch information
BridgeAR committed May 18, 2020
commit 421355367cda0e2f337277d214ee8af106a399ac
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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