Check for the arguments object. If it exists, you're in the function. If it doesn't it has been eval ed.

Note that you'll have to put the check for arguments in a try...catch block like this:

var s = 'try {document.writeln(arguments ? "Function" : "Eval") } catch(e) { document.writeln("Eval!") }'; (new Function(s))(); eval(s);

Demo

Solution to nnnnnn 's concern. For this, I've edited the eval function itself: