-
Notifications
You must be signed in to change notification settings - Fork 166
Editorial: various fixes #1051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editorial: various fixes #1051
Conversation
Interesting. The fact that all the tests passed with this typo indicates a lack of test coverage. Would you be up for fixing that too? (Not a requirement for merging.) |
04a2e26
to
b48b388
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a drive-by fix for a related check that is now redundant. (I could also move this to a separate PR, if you prefer.)
1. Let |readableController| be |readable|.\[[readableStreamController]]. | ||
1. If ! [$ReadableStreamDefaultControllerCanCloseOrEnqueue$](|readableController|) is true, | ||
perform ! [$ReadableStreamDefaultControllerClose$](|readableController|). | ||
1. Perform ! [$ReadableStreamDefaultControllerClose$](|readable|.\[[readableStreamController]]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ReadableStreamDefaultControllerCanCloseOrEnqueue
check has become redundant, similar to this change in TransformStreamDefaultControllerTerminate
.
I think the same problems arise as in the original PR. These changes are inside abstract operations that are not directly accessible through the API. The API will throw a You'd need to find some other abstract operation which doesn't perform these checks on its own in advance. For |
I might be going on a bit of a tangent here, but... Now that
(Even more of a tangent: I just noticed that the anchor links for these transform stream abstract ops are weird. For example, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I think it's less clear-cut for TransformStreamDefaultControllerEnqueue because it is already handling the exceptional case, so there is no danger of state confusion. I don't feel strongly that we need to be consistent here. |
In that case, can we change them to asserts?
It looks like this might have a normative effect on SetUpTransformStreamDefaultControllerFromTransformer, where 2.2 would no longer trigger. I'm not sure though if the branch is ever reached though...
This was presumably broken in the Web IDL rewrite; good catch! https://streams.spec.whatwg.org/commit-snapshots/cfcd303a38158e4ec3837d1028158c88d505c35d/#transform-stream-default-controller-enqueue has the more-correct abstract operation IDs. A fix, perhaps in this PR, would be lovely. |
Uhm, I thought the whole point of #1029 was to change the asserts into early-exits, so that if other specs want to use the abstract op, they don't have to do the checks themselves? Now you want to change them back to asserts? I'm not sure I'm following... 😕
Hmm, good point, I seem to have missed that usage of However, even in that case, I think we won't reach ...I think. I'm not confident enough about it to actually change
Will do. 🙂 |
e117ea8
to
2ef17ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, I thought the whole point of #1029 was to change the asserts into early-exits, so that if other specs want to use the abstract op, they don't have to do the checks themselves? Now you want to change them back to asserts? I'm not sure I'm following... 😕
Yeah, OK, fair... I guess I'm still kind of uneasy with the resolution of #1029, based on the fact that it's untestable and the comment in #1029 (comment). I think our best path forward is to just finish up this PR's uncontroversial aspects, and then maaaaybe come back to the early-exit vs. throw vs. assert discussion separately. Maybe after I eventually create a better interface for other specs to use streams abstract ops (#372).
In which case, this LGTM. I'll let @ricea have another look though just in case, before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
[[closeRequested]]
instead of[[closeRequest]]
. Looks like we missed this in Add state checks to Close() and Enqueue() #1029. 😅ReadableStreamDefaultControllerCanCloseOrEnqueue
check inTransformStreamDefaultSinkCloseAlgorithm
.Add missing link toWas already fixed in 63b4407.ReadableStreamDefaultControllerEnqueue
insideReadableStreamTee
.TransformStream
abstract ops, which were presumable broken in the WebIDL rewrite.Preview | Diff