(stream, ws, script, sessionId)
| 14 | |
| 15 | class ScriptLayer { |
| 16 | constructor(stream, ws, script, sessionId) { |
| 17 | this.stream = stream; |
| 18 | this.sessionId = sessionId; |
| 19 | this.script = script; |
| 20 | this.step = 1; |
| 21 | this.pending = null; |
| 22 | this.buffer = ""; |
| 23 | this.running = false; |
| 24 | this.handlers = new Set(); |
| 25 | this.events = []; |
| 26 | this.commandQueue = []; |
| 27 | this.commandIndex = 0; |
| 28 | this.suppressOutput = true; |
| 29 | this.onData = this.onData.bind(this); |
| 30 | this.onClose = this.onClose.bind(this); |
| 31 | } |
| 32 | |
| 33 | broadcast(type, payload = {}) { |
| 34 | const msg = SCRIPT_MAGIC + JSON.stringify({ type, ...payload }); |
nothing calls this directly
no outgoing calls
no test coverage detected