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
|
|
Superseded by #55067 |
Fixes #54603
Ref #50107