mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
1fc373bdf6
This reverts commit de848ac1e0
.
The commit broke multiline repl.
PR-URL: https://github.com/nodejs/node/pull/18715
Refs: https://github.com/nodejs/node/pull/17828
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@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');
|
|
}
|