Short question, if this works (and it does):
eval("new " + generator.className + "(" + generator.constructorArgs.join(", ") + ")");
why doesn't this work:
eval(generator.className + ".prototype.constructor.apply({}, generator.constructorArgs);");
The second expression always returns undefined, but in my opinion it should work. I tried it on dummy objects like:
var dummy = function () {};
Also, is there any way I can avoid using eval in this situation?
Thanks,
Alex