From 766506a2e947b297926e046051841eae78705b92 Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Thu, 13 Jul 2017 14:17:33 -0400 Subject: [PATCH] repl: deprecate REPLServer.parseREPLKeyword This method does not need to be visible to user code. It has been undocumented since it was introduced which was perhaps v0.8.9. The motivation for this change is that the method is simply an implementation detail of the REPLServer behavior, and does not need to be exposed to user code. This change adds documentation of the method with a deprecation warning, and a test that the method is actually documented. PR-RUL: https://github.com/nodejs/node/pull/14223 Refs: https://github.com/nodejs/node/issues/7619 Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- doc/api/deprecations.md | 8 +++++++ doc/api/repl.md | 14 +++++++++++ lib/repl.js | 32 ++++++++++++------------- test/parallel/test-repl-deprecations.js | 16 +++++++++++++ 4 files changed, 53 insertions(+), 17 deletions(-) create mode 100644 test/parallel/test-repl-deprecations.js diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f6c51217e0eae3..c34f4e04d97923 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -653,6 +653,14 @@ Type: Runtime The `REPLServer.bufferedCommand` property was deprecated in favor of [`REPLServer.clearBufferedCommand()`][]. + +### DEP0075: REPLServer.parseREPLKeyword() + +Type: Runtime + +`REPLServer.parseREPLKeyword()` was removed from userland visibility. + + [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array [`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer diff --git a/doc/api/repl.md b/doc/api/repl.md index 7a9c1f81e56309..4ed95f61116b11 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -385,6 +385,20 @@ buffered but not yet executed. This method is primarily intended to be called from within the action function for commands registered using the `replServer.defineCommand()` method. +### replServer.parseREPLKeyword(keyword, [rest]) + + +* `keyword` {string} the potential keyword to parse and execute +* `rest` {any} any parameters to the keyword command + +> Stability: 0 - Deprecated. + +An internal method used to parse and execute `REPLServer` keywords. +Returns `true` if `keyword` is a valid keyword, otherwise `false`. + ## repl.start([options])