It's freezing them because mutating has no effect (you can only trigger a change through assignment) and yes, it's *extremely* surprising. It's an API that should never have made it off a whiteboard during an initial brainstorming session
-
-
Replying to @Rich_Harris @hasparus and
It's also, unfortunately, exactly the API shape that webidl currently recommends, because we don't like all the bespoke shitty fake arrays in the platform, but also tc39 has drug their feet on allowing good fake arrays for years (despite my strong efforts
)
Still trying tho.3 replies 0 retweets 3 likes -
Replying to @tabatkins @Rich_Harris and
Since all the Array methods work on anything sufficiently Array-like (just need index props and length prop), would it be possible to make things that are Array-like in all respects but instanceof with no TC-39 level changes by specing that those methods are copied to the proto?
1 reply 0 retweets 2 likes -
Replying to @othermaciej @Rich_Harris and
Theoretically yes, tho we do need to make a final decision on whether the methods should always return Arrays or the specific class. (Tho some methods like .filter() are attractive, I think "always return an Array" is probably the better option as long as there's a good constr.)
2 replies 0 retweets 3 likes -
Replying to @tabatkins @Rich_Harris and
The effect of what I described would be that methods which return a new array would return a vanilla Array. This is ok as long as we have readonly properties pointing to either mutable or frozen quasi-arrays, thus not needing to worry about assignment.
1 reply 0 retweets 2 likes -
Replying to @othermaciej @tabatkins and
In other words, the pattern would be that you never make these, just read from or manipulate ones attached to DOM properties.
1 reply 0 retweets 1 like -
Replying to @othermaciej @tabatkins and
This should also compatibly upgrade to proper TC-39-level support for Array subtypes, only instanceof would change.
1 reply 0 retweets 1 like -
Replying to @othermaciej @tabatkins and
The subclassability features of array were specifically designed to support these sort of things. Tell me you requirements and I can probably suggest several ways to accomplish them.
1 reply 0 retweets 1 like -
Replying to @awbjs @othermaciej and
Domenic put up a PR for review on this a few days ago: https://github.com/heycam/webidl/pull/836 … Please comment there and +1 if it's good.
1 reply 0 retweets 1 like -
Ah,
@bz_moz wasn't included in this particular thread endpoint. Here you go:https://github.com/heycam/webidl/pull/836 …1 reply 0 retweets 1 like
Yep, I saw that PR, and of course the issue it's filed based on. Haven't had a chance to look at the PR carefully yet, and probably will not until next week, unfortunately.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.