node/test/parallel/test-repl-memory-deprecation.js
Lance Ball 7a29f44071
repl: deprecate REPLServer.prototype.memory
This method is only useful for the internal mechanics of the REPLServer
and does not need to be exposed in user space. It was previously not
documented, so I believe a Runtime deprecation makes sense.

PR-URL: https://github.com/nodejs/node/pull/16242
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-10-19 14:58:26 -04:00

16 lines
377 B
JavaScript

'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);
assert.strictEqual(server.memory(), undefined);
server.close();
}