MCPcopy Index your code
hub / github.com/nodejs/node / run

Method run

test/parallel/test-repl-permission-model.js:17–36  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

15// Create an input stream specialized for testing an array of actions
16class ActionStream extends stream.Stream {
17 run(data) {
18 const _iter = data[Symbol.iterator]();
19 const doAction = () => {
20 const next = _iter.next();
21 if (next.done) {
22 // Close the repl. Note that it must have a clean prompt to do so.
23 this.emit('keypress', '', { ctrl: true, name: 'd' });
24 return;
25 }
26 const action = next.value;
27
28 if (typeof action === 'object') {
29 this.emit('keypress', '', action);
30 } else {
31 this.emit('data', `${action}`);
32 }
33 setImmediate(doAction);
34 };
35 doAction();
36 }
37 resume() {}
38 pause() {}
39}

Callers 1

runTestFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected