diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 79060f1db76db8..1d39dfc337636b 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1547,12 +1547,15 @@ code, no replacement API is provided. ### DEP0074: `REPLServer.bufferedCommand` -Type: Runtime +Type: End-of-Life The `REPLServer.bufferedCommand` property was deprecated in favor of [`REPLServer.clearBufferedCommand()`][]. @@ -1561,12 +1564,15 @@ The `REPLServer.bufferedCommand` property was deprecated in favor of ### DEP0075: `REPLServer.parseREPLKeyword()` -Type: Runtime +Type: End-of-Life `REPLServer.parseREPLKeyword()` was removed from userland visibility. @@ -1622,12 +1628,15 @@ supported API. ### DEP0078: `REPLServer.turnOffEditorMode()` -Type: Runtime +Type: End-of-Life `REPLServer.turnOffEditorMode()` was removed from userland visibility. @@ -1687,12 +1696,15 @@ file descriptors. ### DEP0082: `REPLServer.prototype.memory()` -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. @@ -2385,12 +2397,15 @@ Setting the TLS ServerName to an IP address is not permitted by ### DEP0124: using `REPLServer.rli` -Type: Runtime +Type: End-of-Life This property is a reference to the instance itself. diff --git a/lib/repl.js b/lib/repl.js index 41aaf126e39b94..03632e25a361c2 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -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}(.*)` + @@ -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 ? @@ -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']); @@ -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 = @@ -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. diff --git a/test/parallel/test-repl-deprecations.js b/test/parallel/test-repl-deprecations.js deleted file mode 100644 index dbd50eb469f15a..00000000000000 --- a/test/parallel/test-repl-deprecations.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; -const common = require('../common'); -const assert = require('assert'); -const repl = require('repl'); - -testParseREPLKeyword(); - -function testParseREPLKeyword() { - const server = repl.start({ prompt: '> ' }); - const warn = 'REPLServer.parseREPLKeyword() is deprecated'; - - common.expectWarning('DeprecationWarning', warn, 'DEP0075'); - assert.ok(server.parseREPLKeyword('clear')); - assert.ok(!server.parseREPLKeyword('tacos')); - server.close(); -} diff --git a/test/parallel/test-repl-memory-deprecation.js b/test/parallel/test-repl-memory-deprecation.js deleted file mode 100644 index 07d377d8fbf9fc..00000000000000 --- a/test/parallel/test-repl-memory-deprecation.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -const common = require('../common'); -const assert = require('assert'); -const repl = require('repl'); - -testMemory(); - -function testMemory() { - const server = repl.start({ prompt: '> ' }); - const warn = 'REPLServer.memory() is deprecated'; - - common.expectWarning('DeprecationWarning', warn, 'DEP0082'); - assert.strictEqual(server.memory(), undefined); - server.close(); -} diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index cb7b2f08b65468..3f6e16ee47fba2 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -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', } }); @@ -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() {} @@ -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, diff --git a/test/parallel/test-repl-turn-off-editor-mode.js b/test/parallel/test-repl-turn-off-editor-mode.js deleted file mode 100644 index a966899b2c6391..00000000000000 --- a/test/parallel/test-repl-turn-off-editor-mode.js +++ /dev/null @@ -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(); -}