stream: construct correct prototype to transferred streams#55047
stream: construct correct prototype to transferred streams#55047avivkeller wants to merge 1 commit intonodejs:mainfrom
Conversation
| stream.constructor = ReadableStream; | ||
|
|
||
| return stream; | ||
| return ReflectConstruct(function() { |
There was a problem hiding this comment.
ReflectConstruct is extremely slow.
There was a problem hiding this comment.
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.
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.
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