mmckegg / notevil

Evalulate javascript like the built-in javascript eval() method but safely.
195 stars 24 forks source link

inner contexts shadow parent even if variable hasn't been defined #8

Closed mmckegg closed 10 years ago

mmckegg commented 10 years ago
safeEval('var result = 0; [1,2,3,4].forEach(function(item){ result += item }); result')
// result still 0, eval() returns 10