Re: Why are global variables *non-deletable* properties of the global object?

2008-06-20 Thread Brendan Eich
On Jun 19, 2008, at 8:40 PM, Mark S. Miller wrote: Try putting this in a Firefox address toolbar: javascript:alert('foo' in window); var foo = 42; alert(delete foo); alert(foo) You will get true (because the var binding -- not initialization -- is hoisted to the top of the program,

Re: Why are global variables *non-deletable* properties of the global object?

2008-06-20 Thread Brendan Eich
On Jun 19, 2008, at 11:20 PM, Brendan Eich wrote: It's just a bug in Firefox 2. The bug was https://bugzilla.mozilla.org/show_bug.cgi?id=369259 in case anyone is interested. /be ___ Es4-discuss mailing list Es4-discuss@mozilla.org

Re: Why are global variables *non-deletable* properties of the global object?

2008-06-20 Thread Maciej Stachowiak
On Jun 19, 2008, at 11:20 PM, Brendan Eich wrote: On Jun 19, 2008, at 8:40 PM, Mark S. Miller wrote: Try putting this in a Firefox address toolbar: javascript:alert('foo' in window); var foo = 42; alert(delete foo); alert(foo) You will get true (because the var binding -- not

Why are global variables *non-deletable* properties of the global object?

2008-06-19 Thread Mark S. Miller
In ES3: 10.2.1 Global Code The scope chain is created and initialised to contain the global object and no others. Variable instantiation is performed using the global object as the variable object and using property attributes { DontDelete }. The this value is the global object. I was puzzled

Re: Why are global variables *non-deletable* properties of the global object?

2008-06-19 Thread Brendan Eich
On Jun 19, 2008, at 6:33 PM, Brendan Eich wrote: If you are using the squarefree.com then you're not testing an ES-anything- conformant global object implementation! I meant to hyperlink shell after the squarefree.com in this sentence to http://www.squarefree.com/shell/shell.html Indeed

Re: Why are global variables *non-deletable* properties of the global object?

2008-06-19 Thread Mark S. Miller
On Thu, Jun 19, 2008 at 6:33 PM, Brendan Eich [EMAIL PROTECTED] wrote: On Jun 19, 2008, at 4:39 PM, Mark S. Miller wrote: How did you test? I was indeed using the squarefree shell. Try putting this in a Firefox address toolbar: javascript:alert('foo' in window); var foo = 42; alert(delete