I m looking for the best way to replace eval( "new object();" )
The ugly source :
//var type = window.$(droppedDomNode).data("shape");
var type = "sankey.shape.Start";
var figure = eval("new "+type+"();");
// create a command for the undo/redo support
var command = new draw2d.command.CommandAdd(this, figure, x, y);
The eval create a new sankey.shape.Start object.
I'm looking for best solution to replace this kind of code.
Thanks