( request: Request, id: number, text: string, debug: boolean, )
| 4535 | } |
| 4536 | |
| 4537 | function emitTextChunk( |
| 4538 | request: Request, |
| 4539 | id: number, |
| 4540 | text: string, |
| 4541 | debug: boolean, |
| 4542 | ): void { |
| 4543 | if (byteLengthOfChunk === null) { |
| 4544 | // eslint-disable-next-line react-internal/prod-error-codes |
| 4545 | throw new Error( |
| 4546 | 'Existence of byteLengthOfChunk should have already been checked. This is a bug in React.', |
| 4547 | ); |
| 4548 | } |
| 4549 | if (debug) { |
| 4550 | request.pendingDebugChunks++; |
| 4551 | } else { |
| 4552 | request.pendingChunks++; // Extra chunk for the header. |
| 4553 | } |
| 4554 | const textChunk = stringToChunk(text); |
| 4555 | const binaryLength = byteLengthOfChunk(textChunk); |
| 4556 | const row = id.toString(16) + ':T' + binaryLength.toString(16) + ','; |
| 4557 | const headerChunk = stringToChunk(row); |
| 4558 | if (__DEV__ && debug) { |
| 4559 | request.completedDebugChunks.push(headerChunk, textChunk); |
| 4560 | } else { |
| 4561 | request.completedRegularChunks.push(headerChunk, textChunk); |
| 4562 | } |
| 4563 | } |
| 4564 | |
| 4565 | function serializeEval(source: string): string { |
| 4566 | if (!__DEV__) { |
no test coverage detected