fix(decorators): fixed decorators

This commit is contained in:
vsavkin 2015-05-06 21:08:55 -07:00
parent cb87fa0970
commit 49777648b3
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ export function makeDecorator(annotationCls) {
throw 'reflect-metadata shim is required when using class decorators';
}
var annotationInstance = Object.create(annotationCls);
annotationInstance.call(annotationInstance, args);
annotationCls.call(annotationInstance, args);
return function(cls) {
var annotations = Reflect.getMetadata('annotations', cls);
annotations = annotations || [];
@ -29,7 +29,7 @@ export function makeParamDecorator(annotationCls) {
throw 'reflect-metadata shim is required when using parameter decorators';
}
var annotationInstance = Object.create(annotationCls);
annotationInstance.call(annotationInstance, args);
annotationCls.call(annotationInstance, args);
return function(cls, unusedKey, index) {
var parameters = Reflect.getMetadata('parameters', cls);
parameters = parameters || [];