In JS functions are first class, so one might attempt:
function wut() {
var x = 1;
var obj = {sneaky: eval};
obj.sneaky("x++");
console.log(x);
}
Here we are calling `obj.sneaky()` with some JS code. The sneaky property is the eval function: won't it run the code and thereby increment x?The answer is no: because the caller's name 'obj.sneaky' does not literally compare equal to "eval", the eval function is run with global scope instead of local scope. Therefore the 'x' inside the eval'd string is a global property, not the local variable.
So with this analysis we can (statically) apply constant propagation and replace x with 1.
Now if we replace obj.sneaky with eval, the string comparison succeeds, it becomes "direct eval", and the constant propagation is invalid.