Cannot create a JavaScript "Function" object

You could use a JS interpreter. Take a look at @kerrishotts comment in Can I use `eval` or similar functions? for some options. May I ask what you’ll use that for? As you’ve said, the prevention of something like this is there for a reason (and one should therefore not just work around that without being extremely careful)…