Re:Javascript patterns
by dpweb on Wednesday January 01, 2014 @09:56PM
(#6997933)
Why call eval like this? (1, eval)('this');
[ Parent
| on HN ]
I'm pretty sure it's due to http://es5.github.io/#x10.4.2 section 1A.
Calling eval like that causes it to be an indirect eval call which results in it being executed in the global context.
Re:Javascript patterns
by nairteashop on Thursday January 02, 2014 @02:32AM
(#6998603)
I was wondering too. There is a nice answer at SO that expands on what dcherman said: http://stackoverflow.com/a/9107367