Re: [whatwg/webidl] ObservableArray types in namespace (#1000)

It's hard for me to load all the context of observable arrays back into my head. However I can give some broad stroke responses:

- In general I find `Array`'s data-property-like semantics bizarre and undesirable, even for `Array` itself. The way in which changing `array[numericProp]` will also impact `array.length` feels much more like a setter and the way it's defined by just shoving the setter behavior into `[[DefineOwnProperty]]` seems like bad language layering. I haven't done a deep analysis of the alternatives but this is just a gut feeling that guided my design. 
- This is especially true for something as dynamic as observable arrays which have a backing store they consult (i.e., a getter that feels nontrivial) and which run arbitrary spec code and type conversion on sets (i.e., a setter that is definitely nontrivial).
- The special out-of-bounds behavior seems pretty important to me.
- It's very possible we've made a mistake in some design of the hooks, e.g. by not checking receivers correctly. Any test cases and spec fixes to accompany them would probably be welcome.
- However if the motivating "use case" is assigning to `({ __proto__: document.adoptedStyleSheets })[0]` then I'm not sure how much I care. I'd hope for a more realistic example of something a web developer might actually write that could cause unexpected behavior.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1000#issuecomment-1116552137
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1000/1116552137@github.com>

Received on Tuesday, 3 May 2022 20:20:51 UTC