(chunk)
| 236 | start(c) { controller = c; }, |
| 237 | |
| 238 | write(chunk) { |
| 239 | try { |
| 240 | options[kValidateChunk]?.(chunk); |
| 241 | if (!streamWritable.writableObjectMode && isAnyArrayBuffer(chunk)) { |
| 242 | chunk = new Uint8Array(chunk); |
| 243 | } |
| 244 | if (streamWritable.writableNeedDrain || !streamWritable.write(chunk)) { |
| 245 | backpressurePromise = PromiseWithResolvers(); |
| 246 | if (!streamWritable.writableNeedDrain) { |
| 247 | backpressurePromise.resolve(); |
| 248 | } |
| 249 | return SafePromisePrototypeFinally( |
| 250 | backpressurePromise.promise, () => { |
| 251 | backpressurePromise = undefined; |
| 252 | }); |
| 253 | } |
| 254 | } catch (error) { |
| 255 | // When the kDestroyOnSyncError flag is set (e.g. for |
| 256 | // CompressionStream), a sync throw must also destroy the |
| 257 | // stream so the readable side is errored too. Without this |
| 258 | // the readable side hangs forever. This replicates the |
| 259 | // TransformStream semantics: error both sides on any throw |
| 260 | // in the transform path. |
| 261 | if (options[kDestroyOnSyncError]) { |
| 262 | destroy(streamWritable, error); |
| 263 | } |
| 264 | throw error; |
| 265 | } |
| 266 | }, |
| 267 | |
| 268 | abort(reason) { |
| 269 | destroy(streamWritable, reason); |
nothing calls this directly
no test coverage detected
searching dependent graphs…