Skip to content

Commit b0c735f

Browse files
committed
fix(decorators): incorrect annotation to decorator adapter
1 parent 0e2047f commit b0c735f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/angular2/src/util/decorators.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export function makeDecorator(annotationCls) {
99
if (!(Reflect && Reflect.getMetadata)) {
1010
throw 'reflect-metadata shim is required when using class decorators';
1111
}
12-
var annotationInstance = Object.create(annotationCls);
13-
annotationCls.call(annotationInstance, args);
12+
var annotationInstance = Object.create(annotationCls.prototype);
13+
annotationCls.apply(annotationInstance, args);
1414
return function(cls) {
1515
var annotations = Reflect.getMetadata('annotations', cls);
1616
annotations = annotations || [];
@@ -28,8 +28,8 @@ export function makeParamDecorator(annotationCls) {
2828
if (!(Reflect && Reflect.getMetadata)) {
2929
throw 'reflect-metadata shim is required when using parameter decorators';
3030
}
31-
var annotationInstance = Object.create(annotationCls);
32-
annotationCls.call(annotationInstance, args);
31+
var annotationInstance = Object.create(annotationCls.prototype);
32+
annotationCls.apply(annotationInstance, args);
3333
return function(cls, unusedKey, index) {
3434
var parameters = Reflect.getMetadata('parameters', cls);
3535
parameters = parameters || [];

0 commit comments

Comments
 (0)