From c582726f738721b2a6f4849d7e1c105a53bd0062 Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Sat, 23 Sep 2017 00:04:59 +0900 Subject: [PATCH] Fix access to removed _errored and _storedError slots Due to a merge error with https://github.com/whatwg/streams/pull/799 references to the removed [[errored]] and [[storedError]] slots were mistakenly re-introduced. Remove them. --- reference-implementation/lib/transform-stream.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference-implementation/lib/transform-stream.js b/reference-implementation/lib/transform-stream.js index 53c97509e..bb41e8faf 100644 --- a/reference-implementation/lib/transform-stream.js +++ b/reference-implementation/lib/transform-stream.js @@ -290,9 +290,12 @@ class TransformStreamDefaultSink { if (transformStream._backpressure === true) { return transformStream._backpressureChangePromise .then(() => { - if (transformStream._errored === true) { - return Promise.reject(transformStream._storedError); + const writable = transformStream._writable; + const state = writable._state; + if (state === 'erroring') { + return Promise.reject(writable._storedError); } + assert(state === 'writable', 'state is `"writable"`'); return TransformStreamTransform(transformStream, chunk); }); }