Skip to content
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

fix: make WHATWG streams more compliant #10967

Merged
merged 7 commits into from Jun 15, 2021

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Jun 14, 2021

This PR fixes a lot of WPT tests, mainly by moving a lot of the custom validation logic to use converters from the deno_webidl crate. It also fixes various issue with how callbacks are handled and normalized.

There are still many, many failing tests, but I would rather land this as is to not inflate the diff on this PR even more.

@lucacasonato lucacasonato marked this pull request as ready for review June 15, 2021 10:38
@@ -3475,7 +3635,11 @@
* @param {R} chunk
* @returns {void}
*/
enqueue(chunk) {
enqueue(chunk = undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is odd... is there a reason?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup - prototype.enqueue.length will be wrong otherwise (1 instead of 0). Optional fields shouldn't count towards length, and this marks a field as optional in JS.

Copy link
Contributor

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one comment on an odd coding style.

@lucacasonato lucacasonato merged commit 4cbc4a7 into denoland:main Jun 15, 2021
@lucacasonato lucacasonato deleted the streams_compliance branch June 15, 2021 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants