-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
stream: construct correct prototype to transferred streams #55047
Conversation
stream.constructor = ReadableStream; | ||
|
||
return stream; | ||
return ReflectConstruct(function() { |
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.
ReflectConstruct is extremely slow.
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.
I'm aware, is there another way to make this WPT compliant? We need a way to have the prototype of the transferred stream === the original prototype.
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.
FWIW regarding speed, this has around a -20% on speed, so not good. Is there a reason we can't just return ReadableStream
as is?
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.
Deno solves this by adding a special overload to their ReadableStream
constructor, which essentially skips the regular steps. Maybe we should do something similar?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55047 +/- ##
==========================================
- Coverage 88.24% 88.22% -0.02%
==========================================
Files 652 652
Lines 183886 183867 -19
Branches 35855 35859 +4
==========================================
- Hits 162263 162221 -42
- Misses 14902 14919 +17
- Partials 6721 6727 +6
|
Superseded by #55067 |
Fixes #54603
Ref #50107