Subj : Array and [ ] To : netscape.public.mozilla.jseng From : Igor Bukanov Date : Fri Jan 21 2005 11:49 pm Hi! Consider the following JS: function Array() { if (typeof alert == "function") alert("Intercepted"); else print("Intercepted"); } var x = []; In SpiderMonkey and Rhino it prints "Intercepted", while in MS JScript it prints nothing, that is AFAICS in MS JScript [] always uses original Array constructor while SM and Rhino literally follows 11.1.4 in ECMAScript standard which states: The production ArrayLiteral : [ Elision opt ] is evaluated as follows: 1. Create a new array as if by the expression "new Array()" .... Clearly MS JScript violates this (although I can imagine that "as if by the expression" can be interpreted in a way that allows MS JScript implementation). But this is a useful violation since I spend some time trying to figure out why a script did not work properly only to find out that [] was called inside "with (objectWithArrayProperty)". So the question is was this ability to change [] semantics via Array modification intentional? Regards, Igor .