mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 14:56:19 +00:00

PR-URL: https://github.com/nodejs/node/pull/14162 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
24 lines
536 B
JavaScript
24 lines
536 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const repl = require('repl');
|
|
|
|
{
|
|
const stream = new common.ArrayStream();
|
|
const options = {
|
|
eval: common.mustCall((cmd, context) => {
|
|
assert.strictEqual(cmd, '.scope\n');
|
|
assert.deepStrictEqual(context, { animal: 'Sterrance' });
|
|
}),
|
|
input: stream,
|
|
output: stream,
|
|
terminal: true
|
|
};
|
|
|
|
const r = repl.start(options);
|
|
r.context = { animal: 'Sterrance' };
|
|
|
|
stream.emit('data', '\t');
|
|
stream.emit('.exit\n');
|
|
}
|