Alternatives for Javascript eval
Mozilla's [Content Security Policy][1] disallows the use of javascript eval function as well as inline scripts. They claim that all instances of eval can be replaced by another (hopefully safer) function. I agree in most scenarios, Javascript eval can be replaced, but I'm not sure whether the replacement is possible for every case. 

My question is twofold:

1. Is there a generic way to replace every javascript eval function? (doesn't have to be safe)
2. Is there a case where the Javascript eval cannot be replaced? 


  [1]: http://people.mozilla.com/~bsterne/content-security-policy/details.html
Alternatives for Javascript eval
===

Mozilla's [Content Security Policy][1] disallows the use of javascript eval function as well as inline scripts. They claim that all instances of eval can be replaced by another (hopefully safer) function. I agree in most scenarios, Javascript eval can be replaced, but I'm not sure whether the replacement is possible for every case. 

My question is twofold:

1. Is there a generic way to replace every javascript eval function? (doesn't have to be safe)
2. Is there a case where the Javascript eval cannot be replaced? 


  [1]: http://people.mozilla.com/~bsterne/content-security-policy/details.html