Skip to content

Commit 3752430

Browse files
committed
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 <[email protected]> PR-URL: #33286 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e88d098 commit 3752430

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2385,12 +2385,15 @@ Setting the TLS ServerName to an IP address is not permitted by
23852385
### DEP0124: using `REPLServer.rli`
23862386
<!-- YAML
23872387
changes:
2388+
- version: REPLACEME
2389+
pr-url: https://github.com/nodejs/node/pull/33286
2390+
description: End-of-Life.
23882391
- version: v12.0.0
23892392
pr-url: https://github.com/nodejs/node/pull/26260
23902393
description: Runtime deprecation.
23912394
-->
23922395
2393-
Type: Runtime
2396+
Type: End-of-Life
23942397
23952398
This property is a reference to the instance itself.
23962399

lib/repl.js

-10
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,6 @@ function REPLServer(prompt,
299299

300300
domainSet.add(this._domain);
301301

302-
let rli = this;
303-
ObjectDefineProperty(this, 'rli', {
304-
get: deprecate(() => rli,
305-
'REPLServer.rli is deprecated', 'DEP0124'),
306-
set: deprecate((val) => rli = val,
307-
'REPLServer.rli is deprecated', 'DEP0124'),
308-
enumerable: true,
309-
configurable: true
310-
});
311-
312302
const savedRegExMatches = ['', '', '', '', '', '', '', '', '', ''];
313303
const sep = '\u0000\u0000\u0000';
314304
const regExMatcher = new RegExp(`^${sep}(.*)${sep}(.*)${sep}(.*)${sep}(.*)` +

test/parallel/test-repl-options.js

-16
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ common.expectWarning({
3737
'repl._builtinLibs is deprecated. Check module.builtinModules instead',
3838
DEP0141: 'repl.inputStream and repl.outputStream is deprecated. ' +
3939
'Use repl.input and repl.output instead',
40-
DEP0124: 'REPLServer.rli is deprecated',
4140
}
4241
});
4342

@@ -62,14 +61,6 @@ assert.strictEqual(r1.ignoreUndefined, false);
6261
assert.strictEqual(r1.replMode, repl.REPL_MODE_SLOPPY);
6362
assert.strictEqual(r1.historySize, 30);
6463

65-
// Test r1 for backwards compact
66-
assert.strictEqual(r1.rli.input, stream);
67-
assert.strictEqual(r1.rli.output, stream);
68-
assert.strictEqual(r1.rli.input, r1.inputStream);
69-
assert.strictEqual(r1.rli.output, r1.outputStream);
70-
assert.strictEqual(r1.rli.terminal, true);
71-
assert.strictEqual(r1.useColors, r1.rli.terminal);
72-
7364
// 2
7465
function writer() {}
7566

@@ -98,13 +89,6 @@ assert.strictEqual(r2.writer, writer);
9889
assert.strictEqual(r2.replMode, repl.REPL_MODE_STRICT);
9990
assert.strictEqual(r2.historySize, 50);
10091

101-
// Test r2 for backwards compact
102-
assert.strictEqual(r2.rli.input, stream);
103-
assert.strictEqual(r2.rli.output, stream);
104-
assert.strictEqual(r2.rli.input, r2.inputStream);
105-
assert.strictEqual(r2.rli.output, r2.outputStream);
106-
assert.strictEqual(r2.rli.terminal, false);
107-
10892
// 3, breakEvalOnSigint and eval supplied together should cause a throw
10993
const r3 = () => repl.start({
11094
breakEvalOnSigint: true,

0 commit comments

Comments
 (0)