I'm not really sure how you're expecting to get an answer "according to TC39." 
One member had replied and given his suggestion. I don't think it's a good one 
for new APIs; I think new APIs should use arrays and not type check on sets but 
at processing time. I'm sure there will be many other opinions from other TC39 
members.


________________________________
From: "Tab Atkins Jr." <[email protected]>
Sent: Jun 9, 2017 5:02 PM
To: Adam Klein
Cc: es-discuss
Subject: Re: Intercepting sets on array-like objects

On Fri, Jun 9, 2017 at 1:57 PM, Adam Klein <[email protected]> wrote:
> On Thu, Jun 8, 2017 at 11:32 AM, Tab Atkins Jr. <[email protected]>
> wrote:
>> Note that if we don't get some variant of this functionality, these
>> APIs will instead do one of:
>>
>> * just using Proxies (already defined in WebIDL)
>
>
> When you say "Proxies" here, I believe you're referring to the "indexed
> properties" feature of WebIDL
> (https://heycam.github.io/webidl/#idl-indexed-properties). This seems like
> the right mechanism to use, from a WebIDL spec, to get the behavior you
> desire. In Chromium/V8, this doesn't actually use Proxies under the hood (we
> have something called "indexed property handlers", see the API at
> https://cs.chromium.org/chromium/src/v8/include/v8.h?rcl=ff98ddca4a1770c2868d44f1cdfe1d4656363f30&l=5781),
> but it's definitely implementable using Proxies.

Correct.

WebIDL's indexed getters/setters would fulfill my use-case *exactly*.
If that's okay to use, per TC39 consensus, then awesome!

However, in <https://github.com/heycam/webidl/issues/345#issuecomment-300734048>
Anne says:

> [When] we discussed those kind of approaches with TC39, they told us not
> to and to just use Array. It wasn't just about [], it was also about FileList,
> NodeList, etc. And the problem with those was not that they did not have
> enough methods like Array, it was that they required a proxy.

Thus my confusion/consternation.

If this is incorrect, and indexed getters/setters are indeed fine to
use in new APIs, then we can close this thread "no change" and I can
go away happy. ^_^

~TJ
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to