mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 16:22:29 +00:00

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 <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
17 lines
452 B
JavaScript
17 lines
452 B
JavaScript
'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);
|
|
assert.ok(server.parseREPLKeyword('clear'));
|
|
assert.ok(!server.parseREPLKeyword('tacos'));
|
|
server.close();
|
|
}
|