to this guy
for this hack (my version):
static private function construct(type:Class, args:Array):*
{
//OK SO we can't dynamically pass an array in
//since this is a constructor and not a Function object...
//SO instead we're just going to hardwire it for up to N arguments
//I am so so sorry
//--Nate
if(!args || args.length == 0)
{
return new type();
}
else
{
switch(args.length)
{
case 1:
return new type(args[0]);
case 2:
return new type(args[0],args[1]);
case 3:
return new type(args[0],args[1],args[2]);
case 4:
return new type(args[0],args[1],args[2],args[3]);
case 5:
return new type(args[0],args[1],args[2],args[3],args[4]);
default:
throw new Error("Too many Dao Constructor Arguments: if you need more, expand the switch statement I guess. Sigh.");
}
}
return null;
}
Silent partners in suffering.
I think after that I need to buy you some bad code offsets for Christmas.
ReplyDeleteHahahahahahaha that's great!
ReplyDelete