Skip to content

Commit 8e84f8a

Browse files
jomeiermhevery
authored andcommitted
chore: don't throw if paramTypes is undefined.
Closes angular#1955
1 parent edfbc25 commit 8e84f8a

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

modules/angular2/src/reflection/reflection_capabilities.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,21 @@ export class ReflectionCapabilities {
4848
}
4949

5050
_zipTypesAndAnnotaions(paramTypes, paramAnnotations): List<List<any>> {
51-
var result = ListWrapper.createFixedSize(paramTypes.length);
51+
var result;
52+
53+
if (typeof paramTypes === 'undefined') {
54+
result = ListWrapper.createFixedSize(paramAnnotations.length);
55+
} else {
56+
result = ListWrapper.createFixedSize(paramTypes.length);
57+
}
58+
5259
for (var i = 0; i < result.length; i++) {
5360
// TS outputs Object for parameters without types, while Traceur omits
5461
// the annotations. For now we preserve the Traceur behavior to aid
5562
// migration, but this can be revisited.
56-
if (paramTypes[i] != Object) {
63+
if (typeof paramTypes === 'undefined') {
64+
result[i] = [];
65+
} else if (paramTypes[i] != Object) {
5766
result[i] = [paramTypes[i]];
5867
} else {
5968
result[i] = [];

0 commit comments

Comments
 (0)