Problem with Arguments inheriting from Array

Juriy Zaytsev at
Mon Aug 17 16:14:24 PDT 2009

On Aug 17, 2009, at 7:08 PM, Oliver Hunt wrote:

> I implement the logic to make the Arguments object inherit from  
> Array in WebKit last friday and it's quickly turned up a severe  
> incompatibility with Prototype.js, specifcally Prototype's isArray  
> function:
>   isArray: function(object) {
>     return object != null && typeof object == "object" &&
>       'splice' in object && 'join' in object;
>   }
> This breaks at the very least a number of Apple sites and  
> -- that's just two of the top row of sites on 
> , other sites didn't appear to be broken but then i was merely  
> looking at loading the front page, nothing more.
> Unfortunately the use of 'in' means we also can't just shadow a less  
> useful function with null or undefined for now.
> Due to these site breakages, caused by a major compatibility problem  
> in a fairly major library it seems infeasible to attempt to retrofit  
> array like behaviour onto arguments.

We actually don't do duck-typing anymore, starting from 1.6.1  
(currently RC3), and instead compare [[Class]] with "Array".  
Unfortunately, currently stable release - - still has `in` in  
its `isArray`.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es5-discuss mailing list