Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: remove deprecated repl features #33286

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 20 additions & 5 deletions doc/api/deprecations.md
Expand Up @@ -1547,12 +1547,15 @@ code, no replacement API is provided.
### DEP0074: `REPLServer.bufferedCommand`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/33286
description: End-of-Life.
- version: v9.0.0
pr-url: https://github.com/nodejs/node/pull/13687
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life

The `REPLServer.bufferedCommand` property was deprecated in favor of
[`REPLServer.clearBufferedCommand()`][].
Expand All @@ -1561,12 +1564,15 @@ The `REPLServer.bufferedCommand` property was deprecated in favor of
### DEP0075: `REPLServer.parseREPLKeyword()`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/33286
description: End-of-Life.
- version: v9.0.0
pr-url: https://github.com/nodejs/node/pull/14223
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life

`REPLServer.parseREPLKeyword()` was removed from userland visibility.

Expand Down Expand Up @@ -1622,12 +1628,15 @@ supported API.
### DEP0078: `REPLServer.turnOffEditorMode()`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/33286
description: End-of-Life.
- version: v9.0.0
pr-url: https://github.com/nodejs/node/pull/15136
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life

`REPLServer.turnOffEditorMode()` was removed from userland visibility.

Expand Down Expand Up @@ -1687,12 +1696,15 @@ file descriptors.
### DEP0082: `REPLServer.prototype.memory()`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/33286
description: End-of-Life.
- version: v9.0.0
pr-url: https://github.com/nodejs/node/pull/16242
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life

`REPLServer.prototype.memory()` is only necessary for the internal mechanics of
the `REPLServer` itself. Do not use this function.
Expand Down Expand Up @@ -2385,12 +2397,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
34 changes: 0 additions & 34 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 Expand Up @@ -636,15 +626,6 @@ function REPLServer(prompt,
});

self.clearBufferedCommand();
ObjectDefineProperty(this, 'bufferedCommand', {
get: deprecate(() => self[kBufferedCommandSymbol],
'REPLServer.bufferedCommand is deprecated',
'DEP0074'),
set: deprecate((val) => self[kBufferedCommandSymbol] = val,
'REPLServer.bufferedCommand is deprecated',
'DEP0074'),
enumerable: true
});

function completer(text, cb) {
complete.call(self, text, self.editorMode ?
Expand Down Expand Up @@ -698,11 +679,6 @@ function REPLServer(prompt,
return false;
}

self.parseREPLKeyword = deprecate(
_parseREPLKeyword,
'REPLServer.parseREPLKeyword() is deprecated',
'DEP0075');

self.on('close', function emitExit() {
if (paused) {
pausedBuffer.push(['close']);
Expand Down Expand Up @@ -1058,11 +1034,6 @@ REPLServer.prototype.setPrompt = function setPrompt(prompt) {
Interface.prototype.setPrompt.call(this, prompt);
};

REPLServer.prototype.turnOffEditorMode = deprecate(
function() { _turnOffEditorMode(this); },
'REPLServer.turnOffEditorMode() is deprecated',
'DEP0078');

const requireRE = /\brequire\s*\(\s*['"`](([\w@./-]+\/)?(?:[\w@./-]*))(?![^'"`])$/;
const fsAutoCompleteRE = /fs(?:\.promises)?\.\s*[a-z][a-zA-Z]+\(\s*["'](.*)/;
const simpleExpressionRE =
Expand Down Expand Up @@ -1398,11 +1369,6 @@ REPLServer.prototype.defineCommand = function(keyword, cmd) {
this.commands[keyword] = cmd;
};

REPLServer.prototype.memory = deprecate(
_memory,
'REPLServer.memory() is deprecated',
'DEP0082');

// TODO(BridgeAR): This should be replaced with acorn to build an AST. The
// language became more complex and using a simple approach like this is not
// sufficient anymore.
Expand Down
16 changes: 0 additions & 16 deletions test/parallel/test-repl-deprecations.js

This file was deleted.

15 changes: 0 additions & 15 deletions test/parallel/test-repl-memory-deprecation.js

This file was deleted.

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
14 changes: 0 additions & 14 deletions test/parallel/test-repl-turn-off-editor-mode.js

This file was deleted.