fix(decorators): stop directives inheriting parent class decorators.

Fixes #2291
This commit is contained in:
Jeremy Elbourn
2015-07-28 17:27:33 -07:00
parent 9c19eb906b
commit f7d7789915
3 changed files with 24 additions and 4 deletions

View File

@ -246,7 +246,7 @@ export function makeDecorator(annotationCls, chainFn: (fn: Function) => void = n
isFunction(this) && this.annotations instanceof Array ? this.annotations : [];
chainAnnotation.push(annotationInstance);
var TypeDecorator: TypeDecorator = <TypeDecorator>function TypeDecorator(cls) {
var annotations = Reflect.getMetadata('annotations', cls);
var annotations = Reflect.getOwnMetadata('annotations', cls);
annotations = annotations || [];
annotations.push(annotationInstance);
Reflect.defineMetadata('annotations', annotations, cls);