fix(static_reflector): report methods with decorators in propMetadata as well

This was the behavior of our regular reflector as well, although the
method name does not imply this.

Fixes #10308
Closes #10318
This commit is contained in:
Tobias Bosch
2016-07-27 02:05:07 -07:00
parent 58d9e7fc5a
commit 367f0fd142
3 changed files with 31 additions and 3 deletions

View File

@ -28,6 +28,9 @@ class ClassWithDecorators {
@PropDecorator('p3')
set c(value: any /** TODO #9100 */) {}
@PropDecorator('p4')
someMethod() {}
constructor(@ParamDecorator('a') a: AType, @ParamDecorator('b') b: AType) {
this.a = a;
this.b = b;
@ -178,6 +181,7 @@ export function main() {
var p = reflector.propMetadata(ClassWithDecorators);
expect(p['a']).toEqual([propDecorator('p1'), propDecorator('p2')]);
expect(p['c']).toEqual([propDecorator('p3')]);
expect(p['someMethod']).toEqual([propDecorator('p4')]);
});
it('should return registered meta if available', () => {