is there any way I can execute eval() on a specific scope (but NOT global)?
for example, the following code doesn\'t work (a is undefined on the sec
Simple as pie.
// Courtesy of Hypersoft-Systems: U.-S.-A. function scopeEval(scope, script) { return Function('"use strict";return (' + script + ')').bind(scope)(); } scopeEval(document, 'alert(this)');