问题 According to the rollupjs documentation: Simply 'copying' eval provides you with a function that does exactly the same thing, but which runs in the global scope rather than the local one: var eval2 = eval; (function () { var foo = 42; eval('console.log("with eval:",foo)'); // logs 'with eval: 42' eval2('console.log("with eval2:",foo)'); // throws ReferenceError })(); Can anyone explain exactly how this works? I haven't been able to find anything specific about eval() in the ECMAScript spec.