(request: Request)
| 6278 | } |
| 6279 | |
| 6280 | export function closeDebugChannel(request: Request): void { |
| 6281 | if (!__DEV__) { |
| 6282 | // These errors should never make it into a build so we don't need to encode them in codes.json |
| 6283 | // eslint-disable-next-line react-internal/prod-error-codes |
| 6284 | throw new Error( |
| 6285 | 'closeDebugChannel should never be called in production mode. This is a bug in React.', |
| 6286 | ); |
| 6287 | } |
| 6288 | // This clears all remaining deferred objects, potentially resulting in the completion of the Request. |
| 6289 | const deferredDebugObjects = request.deferredDebugObjects; |
| 6290 | if (deferredDebugObjects === null) { |
| 6291 | throw new Error( |
| 6292 | "resolveDebugMessage/closeDebugChannel should not be called for a Request that wasn't kept alive. This is a bug in React.", |
| 6293 | ); |
| 6294 | } |
| 6295 | deferredDebugObjects.retained.forEach((value, id) => { |
| 6296 | request.pendingDebugChunks--; |
| 6297 | deferredDebugObjects.retained.delete(id); |
| 6298 | deferredDebugObjects.existing.delete(value); |
| 6299 | }); |
| 6300 | enqueueFlush(request); |
| 6301 | } |
no test coverage detected