arguments extending Array?

Hallvord R. M. Steen hallvord at opera.com
Fri Feb 2 10:15:04 PST 2007


Hi,
another question regarding the arguments object (I hope these questions  
dealing with details of existing implementations aren't considered  
off-topic, please shout if they are..)

In Opera's implementation the arguments object extends Array, meaning that  
it has all the Array-related methods and also methods and properties set  
on Array.prototype . This has caused an incompatibility with a recent RC  
of Prototype and is considered a bug - but from blog and E-mail  
correspondence regarding this issue it seems several[1] authors consider  
it a nice feature. The arguments object is already "array-like" and apart  
 from the Prototype issue our implementation has caused us no known  
problems (the workaround for Prototype is relatively simple and they have  
already implemented it AFAIK).

Would it be an idea for ES4 to make arguments extend Array?


[1] See for example currently final comment from _Grey_ on the blog post I  
referred to earlier
http://my.opera.com/hallvors/blog/2007/01/22/quirky-arguments#comments
Also commented on by one or two people in E-mails.

-- 
Hallvord R. M. Steen
Core QA JavaScript tester, Opera Software
http://www.opera.com/
Opera - simply the best Internet experience



More information about the Es4-discuss mailing list