For example, in ES3

11.1.4 Array Initializer
...
1. Create a new array as if by the expression new Array().
...

The phrase "as if by the expression" followed by a literal snippet of
code occurs repeatedly in ES3. I know that ES4 prevents assignment to
the various global variable names used by such code, but what about
shadowing lexical variable definitions? FF 2.0.0.14 on squarefree does
seem to obey the literal reading of the ES3 spec -- that shadowing
affects array and object literals:

(function foo(){
  function Array(){return Date;}
  function Object(){return window;}
  return new window.Array([1,2],{bar:3});
})();
function Date() { [native code] },[object Window]

Safari literals are not affected by such shadowing definitions. Which
behavior does ES4 consider correct?


-- 
    Cheers,
    --MarkM
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to