PSA: WritableStreamDefaultController to be exposed on global object

39 views
Skip to first unread message

Adam Rice

unread,
Jul 6, 2021, 10:06:47 PM7/6/21
to blink-dev
The WritableStreamDefaultController constructor became exposed on the global object in the Streams Standard in June 2020, however due to an oversight Blink's implementation was not updated to match.

Previously, in order to get a reference to the constructor you'd have to write something like

let WritableStreamDefaultController;
new WritableStream({
  start(controller) {
    WritableStreamDefaultController = controller.constructor;
  }
});

This code will still work, but it will no longer be necessary.

This change is purely for standards alignment. It doesn't make much practical difference. Attempting to call the constructor just throws a TypeError. Probably the only reason anyone would want a reference to it is to monkey-patch the prototype.

Rick Byers

unread,
Jul 8, 2021, 5:08:06 PM7/8/21
to Adam Rice, blink-dev
Thanks for the heads up. I agree this is bugfix-level, not worthy of an Intent to Ship.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAC_ixdz-2d7TpToTDX-MbLH0k9WVkHKai9FowpSN5OkW0PwZpQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages