repl: remove deprecated repl.turnOffEditorMode() function

This function is deprecated for multiple years and provides very
little benefit to users. Thus, it's removed to improve the
maintainability of the REPL module.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33286
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ruben Bridgewater 2020-05-07 20:31:03 +02:00
parent a1bcad8dc0
commit f217b2dfb0
3 changed files with 4 additions and 20 deletions

View File

@ -1628,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.

View File

@ -1034,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 =

View File

@ -1,14 +0,0 @@
'use strict';
const common = require('../common');
const repl = require('repl');
testTurnOffEditorMode();
function testTurnOffEditorMode() {
const server = repl.start({ prompt: '> ' });
const warn = 'REPLServer.turnOffEditorMode() is deprecated';
common.expectWarning('DeprecationWarning', warn, 'DEP0078');
server.turnOffEditorMode();
server.close();
}