[Project_owners] Defining new array methods (SeaMonkey vsFirefox).

Peter B. Shalimoff vshalim at home.ru
Sat Jun 24 09:44:02 EDT 2006


Nickolay Ponomarev wrote:
> No, actually it's better to avoid modifying Array.prototype or
> Object.prototype altogether those objects are shared with other
> scripts. Exactly because of this problem - someone will try to use the
> for..in loop to cycle through array's items or object's own
> properties.

Given the fact that script will be executed in an environment that can be
modified by third-party scripts, there are two options: a) to do necessary
type checks inside of a for-in loop, b) to explicitly forbid such
modification in the documentation. Neither is done, so it's someone's
problem.

--
0xdeadbeef



More information about the Project_owners mailing list