Problem with Arguments inheriting from Array

Oliver Hunt oliver at apple.com
Mon Aug 17 16:08:21 PDT 2009


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 Nasa.gov --  
that's just two of the top row of sites on http://www.prototypejs.org/real-world 
, 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.

--Oliver

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090817/b1fa9f7b/attachment.html>


More information about the es5-discuss mailing list