Closed Bug 1508813 Opened 11 months ago Closed 11 months ago

Support subclassing stream classes

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: jorendorff, Assigned: jorendorff)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

class PartyStreamer extends ReadableStream {}
assertEq(new PartyStreamer().__proto__, PartyStreamer.prototype);

We currently fail this test; the new object's [[Prototype]] is ReadableStream.prototype, because it is created by the base-class constructor, which doesn't support subclassing.

The spec is ambiguous about this; see discussion in <https://github.com/whatwg/streams/issues/965>. I expect the standard will be changed to clarify that subclassing is supported.
Pushed by jorendorff@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7bc182b1c57f
ReadableStream subclassing. r=arai
https://hg.mozilla.org/mozilla-central/rev/7bc182b1c57f
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.