fix(decorators): incorrect annotation to decorator adapter
This commit is contained in:
parent
0e2047f9ca
commit
b0c735f72c
|
@ -9,8 +9,8 @@ export function makeDecorator(annotationCls) {
|
||||||
if (!(Reflect && Reflect.getMetadata)) {
|
if (!(Reflect && Reflect.getMetadata)) {
|
||||||
throw 'reflect-metadata shim is required when using class decorators';
|
throw 'reflect-metadata shim is required when using class decorators';
|
||||||
}
|
}
|
||||||
var annotationInstance = Object.create(annotationCls);
|
var annotationInstance = Object.create(annotationCls.prototype);
|
||||||
annotationCls.call(annotationInstance, args);
|
annotationCls.apply(annotationInstance, args);
|
||||||
return function(cls) {
|
return function(cls) {
|
||||||
var annotations = Reflect.getMetadata('annotations', cls);
|
var annotations = Reflect.getMetadata('annotations', cls);
|
||||||
annotations = annotations || [];
|
annotations = annotations || [];
|
||||||
|
@ -28,8 +28,8 @@ export function makeParamDecorator(annotationCls) {
|
||||||
if (!(Reflect && Reflect.getMetadata)) {
|
if (!(Reflect && Reflect.getMetadata)) {
|
||||||
throw 'reflect-metadata shim is required when using parameter decorators';
|
throw 'reflect-metadata shim is required when using parameter decorators';
|
||||||
}
|
}
|
||||||
var annotationInstance = Object.create(annotationCls);
|
var annotationInstance = Object.create(annotationCls.prototype);
|
||||||
annotationCls.call(annotationInstance, args);
|
annotationCls.apply(annotationInstance, args);
|
||||||
return function(cls, unusedKey, index) {
|
return function(cls, unusedKey, index) {
|
||||||
var parameters = Reflect.getMetadata('parameters', cls);
|
var parameters = Reflect.getMetadata('parameters', cls);
|
||||||
parameters = parameters || [];
|
parameters = parameters || [];
|
||||||
|
|
Loading…
Reference in New Issue