()
| 397 | } |
| 398 | } |
| 399 | #drainRawBuffer() { |
| 400 | if (this.#pendingPartialV8Header) { |
| 401 | ArrayPrototypePush(this.#rawBuffer, TypedArrayPrototypeSubarray(v8Header, 0, 1)); |
| 402 | this.#rawBufferSize++; |
| 403 | this.#pendingPartialV8Header = false; |
| 404 | } |
| 405 | |
| 406 | while (this.#rawBuffer.length > 0) { |
| 407 | const prevBufferLength = this.#rawBuffer.length; |
| 408 | const prevBufferSize = this.#rawBufferSize; |
| 409 | this.#processRawBuffer(); |
| 410 | |
| 411 | if (this.#rawBuffer.length === prevBufferLength && |
| 412 | this.#rawBufferSize === prevBufferSize) { |
| 413 | const bufferHead = this.#rawBuffer[0]; |
| 414 | this.addToReport({ |
| 415 | __proto__: null, |
| 416 | type: 'test:stdout', |
| 417 | data: { |
| 418 | __proto__: null, |
| 419 | file: this.name, |
| 420 | message: StringFromCharCode(bufferHead[0]), |
| 421 | }, |
| 422 | }); |
| 423 | |
| 424 | if (TypedArrayPrototypeGetLength(bufferHead) === 1) { |
| 425 | ArrayPrototypeShift(this.#rawBuffer); |
| 426 | } else { |
| 427 | this.#rawBuffer[0] = TypedArrayPrototypeSubarray(bufferHead, 1); |
| 428 | } |
| 429 | this.#rawBufferSize--; |
| 430 | } |
| 431 | } |
| 432 | } |
| 433 | #processRawBuffer() { |
| 434 | // This method is called when it is known that there is at least one message |
| 435 | let bufferHead = this.#rawBuffer[0]; |
no test coverage detected