Intent to Ship: Relative indexing method for Array, String, and TypedArrays

115 views
Skip to first unread message

Shu-yu Guo

unread,
Dec 1, 2020, 7:23:31 PM12/1/20
to blink-dev

Contact emails

s...@chromium.org

Explainer


https://github.com/tc39/proposal-relative-indexing-method

Specification

https://tc39.es/proposal-relative-indexing-method/

Summary

Add a new method, named at(), to Array.prototype, String.prototype, and the TypedArray prototypes, that permit relative indexing with negative indices. ``` let arr = [1,2,3,4]; arr.at(-1); // Returns 4 ```



Blink component

Blink>JavaScript>Language

TAG review

Not needed. Addition of methods to JS built-in prototypes with no interaction with rest of web platform.

TAG review status

Not applicable

Risks



Interoperability and Compatibility

The .at name also has compatibility risk due to old versions of core-js unconditionally shipping a Stage 0 proposal. See https://github.com/zloirock/core-js/pull/889#issuecomment-732359377 for more discussion.



Gecko: Worth prototyping (https://github.com/mozilla/standards-positions/issues/458)

WebKit: In development (https://lists.webkit.org/pipermail/webkit-dev/2020-November/031623.html)

Web developers: No signals


Is this feature fully tested by web-platform-tests?

No, but covered by test262.

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=10961

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6123640410079232

This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Dec 1, 2020, 7:28:29 PM12/1/20
to Shu-yu Guo, blink-dev
LGTM1

--
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/CAN-e9e_t7j7WWnhUqAcve7vAnqi1Qp6nvF5g9%3D5%3Dm%3DPaE4XCfQ%40mail.gmail.com.

Mike West

unread,
Dec 2, 2020, 2:43:05 AM12/2/20
to Chris Harrelson, Shu-yu Guo, blink-dev
LGTM2.

This is a stage 3 proposal in TC39, which is a good signal of support from that community, bolstered by the fact that WebKit has an implementation behind a flag. I note, though, that the Mozilla standards position request was filed ~2 days ago, and hasn't settled on a resolution yet ("So.... any objections to 'worth prototyping'?" is not the same as "Worth Prototyping" :) ). Please keep an eye on that conversation, and circle back if objections are raised?

Thanks!
 
-mike


Manuel Rego Casasnovas

unread,
Dec 2, 2020, 5:42:28 AM12/2/20
to Mike West, Chris Harrelson, Shu-yu Guo, blink-dev
LGTM3

On 02/12/2020 08:42, Mike West wrote:
> LGTM2.
>
> This is a stage 3 proposal in TC39, which is a good signal of support
> from that community, bolstered by the fact that WebKit has an
> implementation behind a flag. I note, though, that the Mozilla standards
> position request was filed ~2 days ago, and hasn't settled on a
> resolution yet ("So.... any objections to 'worth prototyping'?" is not
> the same as "Worth Prototyping" :) ). Please keep an eye on that
> conversation, and circle back if objections are raised?
>
> Thanks!
> -mike
>
>
> On Wed, Dec 2, 2020 at 1:28 AM Chris Harrelson <chri...@chromium.org
> <mailto:chri...@chromium.org>> wrote:
>
> LGTM1
>
> On Tue, Dec 1, 2020 at 4:23 PM Shu-yu Guo <s...@chromium.org
> <mailto:s...@chromium.org>> wrote:
>
>
> Contact emails
>
> s...@chromium.org <mailto:s...@chromium.org>
>
>
> Explainer
>
>
> https://github.com/tc39/proposal-relative-indexing-method
> <https://github.com/tc39/proposal-relative-indexing-method>
>
>
> Specification
>
> https://tc39.es/proposal-relative-indexing-method/
> <https://tc39.es/proposal-relative-indexing-method/>
>
>
> Summary
>
> Add a new method, named at(), to Array.prototype,
> String.prototype, and the TypedArray prototypes, that permit
> relative indexing with negative indices. ``` let arr =
> [1,2,3,4]; arr.at <http://arr.at>(-1); // Returns 4 ```
>
>
>
> Blink component
>
> Blink>JavaScript>Language
> <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EJavaScript%3ELanguage>
>
>
> TAG review
>
> Not needed. Addition of methods to JS built-in prototypes with
> no interaction with rest of web platform.
>
>
> TAG review status
>
> Not applicable
>
>
> Risks
>
>
>
> Interoperability and Compatibility
>
> The .at name also has compatibility risk due to old versions of
> core-js unconditionally shipping a Stage 0 proposal. See
> https://github.com/zloirock/core-js/pull/889#issuecomment-732359377
> <https://github.com/zloirock/core-js/pull/889#issuecomment-732359377>
> for more discussion.
>
>
>
> Gecko: Worth prototyping
> (https://github.com/mozilla/standards-positions/issues/458
> <https://github.com/mozilla/standards-positions/issues/458>)
>
> WebKit: In development
> (https://lists.webkit.org/pipermail/webkit-dev/2020-November/031623.html
> <https://lists.webkit.org/pipermail/webkit-dev/2020-November/031623.html>)
>
> Web developers: No signals
>
>
> Is this feature fully tested by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?
>
> No, but covered by test262.
>
>
> Tracking bug
>
> https://bugs.chromium.org/p/v8/issues/detail?id=10961
> <https://bugs.chromium.org/p/v8/issues/detail?id=10961>
>
>
> Link to entry on the Chrome Platform Status
>
> https://chromestatus.com/feature/6123640410079232
> <https://chromestatus.com/feature/6123640410079232>
>
> This intent message was generated by Chrome Platform Status
> <https://www.chromestatus.com/>.
>
> --
> 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
> <mailto:blink-dev+...@chromium.org>.
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN-e9e_t7j7WWnhUqAcve7vAnqi1Qp6nvF5g9%3D5%3Dm%3DPaE4XCfQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw_pDe7GqVsge17xDxhfUcSM9-xaFL1CTViWzY39VSfU-A%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw_pDe7GqVsge17xDxhfUcSM9-xaFL1CTViWzY39VSfU-A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKXHy%3DdFA%2B1kXV2M3415L2rV_jvHyy2FF-oTvVfmi_ChcLqLYw%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKXHy%3DdFA%2B1kXV2M3415L2rV_jvHyy2FF-oTvVfmi_ChcLqLYw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Shu-yu Guo

unread,
Dec 2, 2020, 11:46:19 AM12/2/20
to Mike West, Chris Harrelson, blink-dev
Good point on Mozilla's standards position, and will do. Anne "thumbs up"ed the "any objections" comment, which I suppose is a bit ambiguous as to whether it's thumbing up "yes there is an objection" or "no there's no objection". I had optimistically interpreted that as "no there's no objection".

Yulia Startsev

unread,
Dec 2, 2020, 12:21:50 PM12/2/20
to Shu-yu Guo, Mike West, Chris Harrelson, blink-dev
I will still wait a bit before going ahead and publishing our position, but you can expect it by the end of the week.

Reply all
Reply to author
Forward
0 new messages