fix(core): make decorators closure safe (#16905)
This is required as e.g. `token` from `@Inject` is accessed in string form via makeParamDecorator but as a property in the `ReflectiveInjector`. Closes #16889 as this is a more general fix.
This commit is contained in:

committed by
Chuck Jazdzewski

parent
5af143e8e4
commit
a80ac0a8d3
@ -114,9 +114,15 @@ export function main() {
|
||||
|
||||
it('should read out the Directive metadata', () => {
|
||||
const directiveMetadata = resolver.resolve(SomeDirective);
|
||||
expect(directiveMetadata)
|
||||
.toEqual(new Directive(
|
||||
{selector: 'someDirective', inputs: [], outputs: [], host: {}, queries: {}}));
|
||||
expect(directiveMetadata).toEqual(new Directive({
|
||||
selector: 'someDirective',
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
host: {},
|
||||
queries: {},
|
||||
exportAs: undefined,
|
||||
providers: undefined
|
||||
}));
|
||||
});
|
||||
|
||||
it('should throw if not matching metadata is found', () => {
|
||||
@ -136,11 +142,25 @@ export function main() {
|
||||
class ChildWithDecorator extends Parent {
|
||||
}
|
||||
|
||||
expect(resolver.resolve(ChildNoDecorator))
|
||||
.toEqual(new Directive({selector: 'p', inputs: [], outputs: [], host: {}, queries: {}}));
|
||||
expect(resolver.resolve(ChildNoDecorator)).toEqual(new Directive({
|
||||
selector: 'p',
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
host: {},
|
||||
queries: {},
|
||||
exportAs: undefined,
|
||||
providers: undefined
|
||||
}));
|
||||
|
||||
expect(resolver.resolve(ChildWithDecorator))
|
||||
.toEqual(new Directive({selector: 'c', inputs: [], outputs: [], host: {}, queries: {}}));
|
||||
expect(resolver.resolve(ChildWithDecorator)).toEqual(new Directive({
|
||||
selector: 'c',
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
host: {},
|
||||
queries: {},
|
||||
exportAs: undefined,
|
||||
providers: undefined
|
||||
}));
|
||||
});
|
||||
|
||||
describe('inputs', () => {
|
||||
|
Reference in New Issue
Block a user