Expose only desired functions to 3rd party plugins in JavaScript
Interesting question,

first things first, it does matter where you run the code. In web browsers, this will always be Window, so eval.call( {} , 'console.log(this)' ) will log Window. link

And, of course, any code reviewer worth his salt will tell you that eval is dangerous, can you update your question and tell us why you need eval ?

In general, I would point you to this for Node for possibly safer ways of accomplishing what you need. For web browsers I would look into running JS in it's own frame ?