InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

_postConstruct ignores MetadataReader

Open ribrdb opened this issue 4 years ago • 0 comments

_postConstruct in src/resolution/instantiation.ts uses Reflect.getMetadata directly instead of using the MetadataReader.

I tried building a MetadataReader using static properties and compiling without reflect-metadata, but I get:

src/resolution/instantiation.ts:37:17 - error TS2339: Property 'hasMetadata' does not exist on type 'typeof Reflect'.
37     if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
                   ~~~~~~~~~~~
src/resolution/instantiation.ts:38:40 - error TS2339: Property 'getMetadata' does not exist on type 'typeof Reflect'.
38         const data: Metadata = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);

ribrdb avatar Aug 31 '21 16:08 ribrdb