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
Add TextEncoderStream and TextDecoderStream transform streams #149
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2756504
Add TextEncoderStream and TextDecoderStream transform streams
ricea 886d920
General fixes
ricea 3b912b3
Make FooAttributes mixins fully own their "slots"
ricea f04369c
Add "this object's" in three places
ricea 6a65ad5
Make TextDecoderStream accept ArrayBufferView types
ricea 343e148
Never enqueue an empty chunk
ricea 6623b0b
Share the "serialize stream" algorithm
ricea 0e64bf8
Use WebIDL to convert chunks for decoding to BufferSource
ricea 407d85d
Translate exceptions from "copy bytes" into rejections
ricea 60854d8
Add missing period.
ricea e5b36e1
address various nits
annevk 12b5161
Remove no-longer-needed ECMASCRIPT refs section
ricea dd65b39
Add one missing word "object"
ricea 66aaab3
Add Mattias Buelens to the acknowledgements
ricea af33687
Add ids to dfns that have moved to TextXcoderCommon
ricea 29fdba4
formatting nits
annevk 256a138
TextDecoderStream should not have decode()
annevk b9dfb01
more nits
annevk File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In 6a65ad5, we explicitly checked for
IsDetachedBuffer(arrayBuffer)
and returned a rejected promise if the buffer was detached. However, none of the three algorithms that make up convert to a BufferSource check for detached buffers.When get a copy of the buffer source encounters a detached buffer, it throws a
TypeError
in step 7. This is not what we want: we want to return a rejected promise instead!I think the easiest fix would be to add the following line to this step, similar to the previous step:
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.
Great catch, thanks.
I did what you proposed. This has the added benefit that we are always in sync with the checks and behaviour provided by WebIDL.