From a416692e93054ad66af315f41647d36611e9ad03 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 7 May 2020 20:33:01 +0200 Subject: [PATCH] repl: remove deprecated repl.memory function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the memory function. It is deprecated for a long time while not being really helpful being exposed. Thus, it is removed to improve maintainability of the REPL module. Signed-off-by: Ruben Bridgewater PR-URL: https://github.com/nodejs/node/pull/33286 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- doc/api/deprecations.md | 5 ++++- lib/repl.js | 5 ----- test/parallel/test-repl-memory-deprecation.js | 15 --------------- 3 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 test/parallel/test-repl-memory-deprecation.js diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 7879aa7d991f98..59232512d4c58d 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1696,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. diff --git a/lib/repl.js b/lib/repl.js index b086cf61adc919..45061119dbc621 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -1352,11 +1352,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-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(); -}