File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
core/core-decorator/src/util Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ import {
33 EggMultiInstancePrototypeInfo ,
44 EggProtoImplClass ,
55 EggPrototypeInfo ,
6- EggPrototypeName ,
6+ EggPrototypeName , InitTypeQualifierAttribute ,
77 InjectConstructorInfo ,
88 InjectObjectInfo ,
9- InjectType ,
9+ InjectType , LoadUnitNameQualifierAttribute ,
1010 MultiInstancePrototypeGetObjectsContext ,
1111 MultiInstanceType ,
1212 QualifierAttribute ,
@@ -186,6 +186,21 @@ export class PrototypeUtil {
186186 const callBackMetadata = MetadataUtil . getMetaData < EggMultiInstanceCallbackPrototypeInfo > ( PrototypeUtil . MULTI_INSTANCE_PROTOTYPE_CALLBACK_PROPERTY , clazz ) ;
187187 if ( callBackMetadata ) {
188188 const objects = callBackMetadata . getObjects ( ctx ) ;
189+ // TODO delete in next major version, default qualifier be added in ProtoDescriptorHelper.addDefaultQualifier
190+ const defaultQualifier = [ {
191+ attribute : InitTypeQualifierAttribute ,
192+ value : callBackMetadata . initType ,
193+ } , {
194+ attribute : LoadUnitNameQualifierAttribute ,
195+ value : ctx . moduleName ,
196+ } ] ;
197+ for ( const object of objects ) {
198+ defaultQualifier . forEach ( qualifier => {
199+ if ( ! object . qualifiers . find ( t => t . attribute === qualifier . attribute ) ) {
200+ object . qualifiers . push ( qualifier ) ;
201+ }
202+ } ) ;
203+ }
189204 return {
190205 ...callBackMetadata ,
191206 objects,
You can’t perform that action at this time.
0 commit comments