Skip to content

Commit

Permalink
Add a local variable to TransformStreamDefaultSink abort()
Browse files Browse the repository at this point in the history
In standard text it is awkward to create an exception object and pass it to an
internal operation in a single step. Add a local to abort() in which the
newly-created TypeError will be placed. This will make the standard text clearer.
  • Loading branch information
ricea authored and domenic committed Oct 6, 2017
1 parent 8efbc19 commit db57115
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reference-implementation/lib/transform-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ class TransformStreamDefaultSink {
abort() {
// abort() is not called synchronously, so it is possible for abort() to be called when the stream is already
// errored.
TransformStreamError(this._ownerTransformStream, new TypeError('Writable side aborted'));
const e = new TypeError('Writable side aborted');
TransformStreamError(this._ownerTransformStream, e);
}

close() {
Expand Down

0 comments on commit db57115

Please sign in to comment.