Your a() function can return the result of eval().
function a(){ return eval("return function(){ return 7 }") }
F = a()
function a(){ return eval("return function(){ return 7 }") }
F = a()
To copy to clipboard, switch view to plain text mode
But I would try something like this:
globalObj = this // global context
function a() { eval("globalObj.F = function(){ return 7; }") }
a()
F()
globalObj = this // global context
function a() { eval("globalObj.F = function(){ return 7; }") }
a()
F()
To copy to clipboard, switch view to plain text mode
Bookmarks