repl: deprecate REPLServer.rli
This is only a reference to the instance and should not be used. PR-URL: https://github.com/nodejs/node/pull/26260 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
8bb30926fd
commit
584305841d
@ -2321,7 +2321,6 @@ Type: Runtime
|
||||
|
||||
Please use `Server.prototype.setSecureContext()` instead.
|
||||
|
||||
|
||||
<a id="DEP0123"></a>
|
||||
### DEP0123: setting the TLS ServerName to an IP address
|
||||
<!-- YAML
|
||||
@ -2336,6 +2335,19 @@ Type: Runtime
|
||||
Setting the TLS ServerName to an IP address is not permitted by
|
||||
[RFC 6066][]. This will be ignored in a future version.
|
||||
|
||||
<a id="DEP0XXX"></a>
|
||||
### DEP0XXX: using REPLServer.rli
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/26260
|
||||
description: Runtime deprecation.
|
||||
-->
|
||||
|
||||
Type: Runtime
|
||||
|
||||
This property is a reference to the instance itself.
|
||||
|
||||
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
|
||||
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
|
||||
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
|
||||
|
11
lib/repl.js
11
lib/repl.js
@ -176,8 +176,15 @@ function REPLServer(prompt,
|
||||
// Context id for use with the inspector protocol.
|
||||
self[kContextId] = undefined;
|
||||
|
||||
// Just for backwards compat, see github.com/joyent/node/pull/7127
|
||||
self.rli = this;
|
||||
let rli = self;
|
||||
Object.defineProperty(self, 'rli', {
|
||||
get: util.deprecate(() => rli,
|
||||
'REPLServer.rli is deprecated', 'DEP0XXX'),
|
||||
set: util.deprecate((val) => rli = val,
|
||||
'REPLServer.rli is deprecated', 'DEP0XXX'),
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
const savedRegExMatches = ['', '', '', '', '', '', '', '', '', ''];
|
||||
const sep = '\u0000\u0000\u0000';
|
||||
|
@ -25,6 +25,12 @@ const ArrayStream = require('../common/arraystream');
|
||||
const assert = require('assert');
|
||||
const repl = require('repl');
|
||||
|
||||
common.expectWarning({
|
||||
DeprecationWarning: {
|
||||
DEP0XXX: 'REPLServer.rli is deprecated'
|
||||
}
|
||||
});
|
||||
|
||||
// Create a dummy stream that does nothing
|
||||
const stream = new ArrayStream();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user