3 ms·
Why call eval like this? (1, eval)('this');
by dpweb 13y ago
Why call eval like this? (1, eval)('this');
- dcherman 13y agoI'm pretty sure it's due to http://es5.github.io/#x10.4.2 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.
- deleted 13y ago[deleted]
- nairteashop 13y agoI was wondering too. There is a nice answer at SO that expands on what dcherman said: http://stackoverflow.com/a/9107367 http://stackoverflow.com/a/9107367
- deleted 13y ago[deleted]
- kangax 13y agohttp://perfectionkills.com/global-eval-what-are-the-options/#indirect_eval_call_theory http://perfectionkills.com/global-eval-what-are-the-options/...