3 ms·
> Technically the engines could be optimizing it when no eval used is detected or when in strict mode (which blocks eval), I just learned about direct vs indir
by nathcd 2y ago
> Technically the engines could be optimizing it when no eval used is detected or when in strict mode (which blocks eval),
I just learned about direct vs indirect eval (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#direct_and_indirect_eval https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...), which I imagine makes this a bit easier. The parent scope is only captured in a direct eval.