Re: [heycam/webidl] Introduce the observable array type (proxy-based) (#840)

TimothyGu commented on this pull request.



> @@ -13629,6 +13803,250 @@ internal method as follows.
     1.  Return <a abstract-op>OrdinaryGetOwnProperty</a>(|O|, |P|).
 </div>
 
+<h3 id="es-observable-arrays">Observable array exotic objects</h3>
+
+An <dfn>observable array exotic object</dfn> is a specific type of ECMAScript
+[=Proxy exotic object=] which is created using the proxy traps defined in this section. They are
+defined in this manner because the ECMAScript specification includes special treatment for
+[=Proxy exotic objects=] that have <code>Array</code> instances as their proxy target, and we want
+to ensure that [=observable array types=] are exposed to ECMAScript code with this special treatment
+intact.

I think we should be clear what this special treatment is (as far as I can tell, IsArray). Even better, I think an implementation note that this is (as @bzbarsky said) "black-box-identical" to having "an IDL object with an indexed getter and indexed setter, but returning true from IsArray and with Array.prototype on the proto chain".

I feel it is regrettable that observable arrays have to be defined this way, and I think having more context in the spec itself will help people in the future understand the decisions being made now.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/840#pullrequestreview-374773720

Received on Sunday, 15 March 2020 06:04:02 UTC