Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

Domenic Denicola d at domenic.me
Fri Nov 14 11:41:30 PST 2014


From: Allen Wirfs-Brock [mailto:allen at wirfs-brock.com] 

> What do you mean by "is an instance of some %ArrayPrototype%"? Do you mean that it has some %ArratPrototype% in it's prototype chain?

Yeah, more or less. A "realm-independent instanceof." This makes sense also from the historical perspective that `Array.isArray` was meant to provide a cross-realm alternative to `instanceof Array`. (I believe that was the case; before my time.)

However as you pointed out in a related conversation this would not be backward-compatible, i.e. it would change the answer for code that does prototype munging.

> This is actually fairly hard to determine.  We look at trying to identify known prototypes independent of realm  for an earlier issue and rejected the possibility because it would require additional tragging of such prototypes.  Also, it wasn't clear who the concept could be extended to JS defined classes.

Right, good points. Probably not the way to go, indeed.



More information about the es-discuss mailing list