rjbrown
13 years agoVisitor
create or overwrite functions with Eval()
Is it possible to use Eval() to create a function? Say I want to make a way of live-patching an app, by bringing down some code via http and then running it with Eval(). Can I actually create a new function (or overwrite an existing one) using Eval(), as I could in say javascript as below?
eval("window.hello = function() { alert('hello world'); }")