@@ -23,22 +23,23 @@ export class EggPrototypeCreatorFactory {
2323
2424 static async createProto ( clazz : EggProtoImplClass , loadUnit : LoadUnit ) : Promise < EggPrototype [ ] > {
2525 let properties : EggPrototypeInfo [ ] = [ ] ;
26+ const defaultQualifier = [ {
27+ attribute : InitTypeQualifierAttribute ,
28+ value : PrototypeUtil . getInitType ( clazz , {
29+ unitPath : loadUnit . unitPath ,
30+ moduleName : loadUnit . name ,
31+ } ) ! ,
32+ } , {
33+ attribute : LoadUnitNameQualifierAttribute ,
34+ value : loadUnit . name ,
35+ } ] ;
36+
2637 if ( PrototypeUtil . isEggMultiInstancePrototype ( clazz ) ) {
2738 const multiInstanceProtoInfo = PrototypeUtil . getMultiInstanceProperty ( clazz , {
2839 unitPath : loadUnit . unitPath ,
2940 moduleName : loadUnit . name ,
3041 } ) ! ;
3142 for ( const obj of multiInstanceProtoInfo . objects ) {
32- const defaultQualifier = [ {
33- attribute : InitTypeQualifierAttribute ,
34- value : PrototypeUtil . getInitType ( clazz , {
35- unitPath : loadUnit . unitPath ,
36- moduleName : loadUnit . name ,
37- } ) ! ,
38- } , {
39- attribute : LoadUnitNameQualifierAttribute ,
40- value : loadUnit . name ,
41- } ] ;
4243 defaultQualifier . forEach ( qualifier => {
4344 if ( ! obj . qualifiers . find ( t => t . attribute === qualifier . attribute ) ) {
4445 obj . qualifiers . push ( qualifier ) ;
@@ -56,7 +57,16 @@ export class EggPrototypeCreatorFactory {
5657 } ) ;
5758 }
5859 } else {
59- properties = [ PrototypeUtil . getProperty ( clazz ) ! ] ;
60+ const property = PrototypeUtil . getProperty ( clazz ) ! ;
61+ if ( ! property . qualifiers ) {
62+ property . qualifiers = [ ] ;
63+ }
64+ defaultQualifier . forEach ( qualifier => {
65+ if ( ! property . qualifiers ! . find ( t => t . attribute === qualifier . attribute ) ) {
66+ property . qualifiers ! . push ( qualifier ) ;
67+ }
68+ } ) ;
69+ properties = [ property ] ;
6070 }
6171 const protos : EggPrototype [ ] = [ ] ;
6272 for ( const property of properties ) {
0 commit comments