Intent to deprecate and remove: SharedArrayBuffer.isView

67 views
Skip to first unread message

Ben Smith

unread,
Dec 11, 2017, 4:54:29 PM12/11/17
to blink-dev

Primary eng (and PM) emails

bi...@chromium.org, bradn...@chromium.org


Summary

SharedArrayBuffer.isView is a function that was accidentally shipped when the SharedArrayBuffer feature was shipped.


It is not in the ECMAscript spec, and it was not implemented by any other browser.


Motivation

This function should be removed for spec and browser compliance.


Interoperability and Compatibility Risk


Risk is very low, this function is unlikely to be used. SharedArrayBuffer is a feature that was recently shipped, the function's utility is limited, and it is not provided by any other browser.

Edge: not supported

Firefox: not supported

Safari: not supported


Alternative implementation suggestion for web developers

This behavior of this function is a duplication of ArrayBuffer.isView.


Usage information from UseCounter

A use counter for this function has not been implemented. 


OWP launch tracking bug

Link to bug (not OWP launch tracking): https://crbug.com/793095


Entry on the feature dashboard

SharedArrayBuffer feature


Requesting approval to remove too?

Yes

Philip Jägenstedt

unread,
Dec 11, 2017, 5:21:46 PM12/11/17
to Ben Smith, blink-dev
Given that nobody else supports this, removal without measuring the usage is probably safe.

I don't quite understand the suggested alternative. SharedArrayBuffer doesn't seem to inherit from ArrayBuffer, so I assume that after this removal there could be some non-exotic code that breaks? (Exotic being relying on exactly where in the prototype chain a thing is.)

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c4a993ca-7d79-4f68-92aa-96bd6ce7323d%40chromium.org.

Ben Smith

unread,
Dec 11, 2017, 7:34:59 PM12/11/17
to blink-dev, bi...@chromium.org
On Monday, December 11, 2017 at 2:21:46 PM UTC-8, Philip Jägenstedt wrote:
Given that nobody else supports this, removal without measuring the usage is probably safe.

I don't quite understand the suggested alternative. SharedArrayBuffer doesn't seem to inherit from ArrayBuffer, so I assume that after this removal there could be some non-exotic code that breaks? (Exotic being relying on exactly where in the prototype chain a thing is.)

Sorry, what I meant by the suggestion is that, as an implementation detail, the current implementation of SharedArrayBuffer.isView is exactly the same as ArrayBuffer.isView. So if someone did happen to use SharedArrayBuffer.isView, they could just switch to that.

Ben Smith

unread,
Dec 11, 2017, 7:37:05 PM12/11/17
to blink-dev, bi...@chromium.org


On Monday, December 11, 2017 at 4:34:59 PM UTC-8, Ben Smith wrote:
On Monday, December 11, 2017 at 2:21:46 PM UTC-8, Philip Jägenstedt wrote:
Given that nobody else supports this, removal without measuring the usage is probably safe.

I don't quite understand the suggested alternative. SharedArrayBuffer doesn't seem to inherit from ArrayBuffer, so I assume that after this removal there could be some non-exotic code that breaks? (Exotic being relying on exactly where in the prototype chain a thing is.)

Sorry, what I meant by the suggestion is that, as an implementation detail, the current implementation of SharedArrayBuffer.isView is exactly the same as ArrayBuffer.isView. So if someone did happen to use SharedArrayBuffer.isView, they could just switch to that.

Oops, clicked send too quick. Yes, it is possible that some code was relying on this function, and would break. I don't think it's very likely though, for the reasons described above.

Chris Harrelson

unread,
Dec 13, 2017, 1:20:12 PM12/13/17
to Ben Smith, blink-dev
LGTM1 to try to ship this change.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/82c8d20e-b874-4472-802c-14994ee661b7%40chromium.org.

Daniel Bratell

unread,
Dec 14, 2017, 9:36:43 AM12/14/17
to Ben Smith, Chris Harrelson, blink-dev
LGTM2

/Daniel
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
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/CAOMQ%2Bw9CGer9Y9hvrnARyy8AQQGhKE-_j3W%2Bhn8Kvb1Zr4vVcw%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

Rick Byers

unread,
Dec 14, 2017, 10:44:20 AM12/14/17
to Daniel Bratell, Ben Smith, Chris Harrelson, blink-dev, Philip Jägenstedt, Mark Dittmer
LGTM3

Any lessons learned for avoiding such accidental shipping in the future?  IDL tooling being discussed wouldn't help since this is ecma262. I don't see SharedArrayBuffer.isView in the webexposed test outputs, why? 


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
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+unsubscribe@chromium.org.



--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

Ben Smith

unread,
Jan 10, 2018, 1:53:22 PM1/10/18
to blink-dev, bra...@opera.com, bi...@chromium.org, chri...@chromium.org, foo...@chromium.org, markd...@chromium.org, Adam Klein

Apologies for the late response. Comments inline:


On Thursday, December 14, 2017 at 7:44:20 AM UTC-8, Rick Byers wrote:
LGTM3

Any lessons learned for avoiding such accidental shipping in the future?  IDL tooling being discussed wouldn't help since this is ecma262. I don't see SharedArrayBuffer.isView in the webexposed test outputs, why? 

Yes, I was wondering about this too. :-)


Apparently JS builtins aren't meant to be in the webexposed list anyway: see comment here. SharedArrayBuffer isn't in this blacklist (though it should be), so it is displayed. Even so, it appears that the interfaces only display properties on the prototype, if one exists. Since SharedArrayBuffer.isView is not on the prototype it isn't displayed.

 
As for how to avoid shipping the wrong thing in the future -- this is a good question. Perhaps v8 needs something similar to the webexposed test? I spoke to Adam and he said that this would be a reasonable addition.

Chris Harrelson

unread,
Jan 10, 2018, 1:56:57 PM1/10/18
to Ben Smith, blink-dev, Daniel Bratell, Philip Jägenstedt, Mark Dittmer, Adam Klein
On Wed, Jan 10, 2018 at 10:53 AM, Ben Smith <bi...@chromium.org> wrote:

Apologies for the late response. Comments inline:


On Thursday, December 14, 2017 at 7:44:20 AM UTC-8, Rick Byers wrote:
LGTM3

Any lessons learned for avoiding such accidental shipping in the future?  IDL tooling being discussed wouldn't help since this is ecma262. I don't see SharedArrayBuffer.isView in the webexposed test outputs, why? 

Yes, I was wondering about this too. :-)


Apparently JS builtins aren't meant to be in the webexposed list anyway: see comment here. SharedArrayBuffer isn't in this blacklist (though it should be), so it is displayed. Even so, it appears that the interfaces only display properties on the prototype, if one exists. Since SharedArrayBuffer.isView is not on the prototype it isn't displayed.

 
As for how to avoid shipping the wrong thing in the future -- this is a good question. Perhaps v8 needs something similar to the webexposed test? I spoke to Adam and he said that this would be a reasonable addition.

+1. This has saved us from accidental launches in several other cases.

Ben Smith

unread,
Jan 10, 2018, 6:14:12 PM1/10/18
to blink-dev, bi...@chromium.org, bra...@opera.com, foo...@chromium.org, markd...@chromium.org, ad...@chromium.org, chri...@chromium.org


On Wednesday, January 10, 2018 at 10:56:57 AM UTC-8, Chris Harrelson wrote:


On Wed, Jan 10, 2018 at 10:53 AM, Ben Smith <bi...@chromium.org> wrote:

Apologies for the late response. Comments inline:


On Thursday, December 14, 2017 at 7:44:20 AM UTC-8, Rick Byers wrote:
LGTM3

Any lessons learned for avoiding such accidental shipping in the future?  IDL tooling being discussed wouldn't help since this is ecma262. I don't see SharedArrayBuffer.isView in the webexposed test outputs, why? 

Yes, I was wondering about this too. :-)


Apparently JS builtins aren't meant to be in the webexposed list anyway: see comment here. SharedArrayBuffer isn't in this blacklist (though it should be), so it is displayed. Even so, it appears that the interfaces only display properties on the prototype, if one exists. Since SharedArrayBuffer.isView is not on the prototype it isn't displayed.

 
As for how to avoid shipping the wrong thing in the future -- this is a good question. Perhaps v8 needs something similar to the webexposed test? I spoke to Adam and he said that this would be a reasonable addition.

+1. This has saved us from accidental launches in several other cases.

I've filed a v8 bug for this: https://crbug.com/v8/7267.
Reply all
Reply to author
Forward
0 new messages