Re: A fun little spec deviation in the major JS engines

2012-01-30 Thread Andreas Rossberg
On 29 January 2012 04:13, Jeff Walden jwalden...@mit.edu wrote: At least, if you consider |with| and |eval| fun (and who doesn't?):  js var x = outer; function f() { with({ x: 17 }) eval(var x); return x; } typeof f()  undefined This is really just an instance of JavaScript's, er, creative

A fun little spec deviation in the major JS engines

2012-01-28 Thread Jeff Walden
At least, if you consider |with| and |eval| fun (and who doesn't?): js var x = outer; function f() { with({ x: 17 }) eval(var x); return x; } typeof f() undefined This seems to be the behavior in every engine out there. But according to the last ES5 errata for 10.5, and in the latest ES6

Re: A fun little spec deviation in the major JS engines

2012-01-28 Thread felix
On Sat, Jan 28, 2012 at 7:13 PM, Jeff Walden jwalden...@mit.edu wrote: At least, if you consider |with| and |eval| fun (and who doesn't?):  js var x = outer; function f() { with({ x: 17 }) eval(var x); return x; } typeof f()  undefined This seems to be the behavior in every engine out

Re: A fun little spec deviation in the major JS engines

2012-01-28 Thread Jeff Walden
On 01/28/2012 08:20 PM, felix wrote: It seems to me the behavior you observe conforms to spec. Hmm, yes, on second look I think you're right. I guess I was reading overfast and missed the variable environment/lexical environment distinction there. That, or it's been too long since I looked