I have the following legacy code that I’d like to remove eval from:
eval('view = new ' + o.base + '(o)');
The best I’ve come up with so far is …
view = eval(o.base).prototype.constructor.apply(o)
… which obviously still uses eval. Can someone please help?
NOTE: The o.base variable is a qualified classname (e.g. “application.area.type.ClassName”) referring to a valid function.
But you can still use
new:UPDATE
A more generic way to achieve this for
o.baserepresenting any qualified name would be: