Permalink
Browse files

Throw an exception if the class couldn't be instantiated.

  • Loading branch information...
1 parent ee87749 commit 8dacf72454e89461a444d6cc9fa02ba1db95ecbd @bysse committed Mar 21, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/org/swiftsuspenders/typedescriptions/ConstructorInjectionPoint.as
View
3 src/org/swiftsuspenders/typedescriptions/ConstructorInjectionPoint.as
@@ -37,9 +37,10 @@ package org.swiftsuspenders.typedescriptions
case 8 : result = new type(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); break;
case 9 : result = new type(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]); break;
case 10 : result = new type(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9]); break;
+ default: throw new Error("The constructor for " + type + " has too many arguments, maximum is 10");
}
p.length = 0;
return result;
}
}
-}
+}

1 comment on commit 8dacf72

@vlaaad

why you can't add more cases?

Please sign in to comment.