Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
popomore committed Sep 19, 2023
1 parent 9bd8979 commit 21c7fd2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface EggMultiInstancePrototypeInfo {
/**
* The class name of the object
*/
className: string;
className?: string;
/**
* obj init type
*/
Expand All @@ -40,7 +40,7 @@ export interface EggMultiInstanceCallbackPrototypeInfo {
/**
* The class name of the object
*/
className: string;
className?: string;
/**
* obj init type
*/
Expand Down
2 changes: 1 addition & 1 deletion core/core-decorator/src/model/EggPrototypeInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface EggPrototypeInfo {
/**
* The class name of the object
*/
className: string;
className?: string;
/**
* obj init type
*/
Expand Down
2 changes: 1 addition & 1 deletion core/metadata/src/impl/EggPrototypeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class EggPrototypeBuilder {
private injectObjects: Array<InjectObject> = [];
private loadUnit: LoadUnit;
private qualifiers: QualifierInfo[] = [];
private className: string;
private className?: string;

static create(ctx: EggPrototypeLifecycleContext): EggPrototype {
const { clazz, loadUnit } = ctx;
Expand Down
4 changes: 2 additions & 2 deletions core/metadata/src/impl/EggPrototypeImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class EggPrototypeImpl implements EggPrototype {
readonly accessLevel: AccessLevel;
readonly injectObjects: InjectObjectProto[];
readonly loadUnitId: Id;
readonly className: string;
readonly className?: string;

constructor(
id: string,
Expand All @@ -32,7 +32,7 @@ export class EggPrototypeImpl implements EggPrototype {
injectObjectMap: InjectObjectProto[],
loadUnitId: Id,
qualifiers: QualifierInfo[],
className: string,
className?: string,
) {
this.id = id;
this.clazz = clazz;
Expand Down
2 changes: 1 addition & 1 deletion core/metadata/src/model/EggPrototype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface EggPrototype extends LifecycleObject<EggPrototypeLifecycleConte
readonly accessLevel: AccessLevel;
readonly loadUnitId: string;
readonly injectObjects: InjectObjectProto[];
readonly className: string;
readonly className?: string;

/**
* get metedata for key
Expand Down
6 changes: 5 additions & 1 deletion standalone/standalone/src/StandaloneInnerObjectProto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class StandaloneInnerObjectProto implements EggPrototype {
readonly accessLevel: AccessLevel;
readonly injectObjects: InjectObjectProto[];
readonly loadUnitId: Id;
readonly className?: string;

constructor(
id: string,
Expand All @@ -33,6 +34,7 @@ export class StandaloneInnerObjectProto implements EggPrototype {
initType: ObjectInitTypeLike,
loadUnitId: Id,
qualifiers: QualifierInfo[],
className?: string,
) {
this.id = id;
this.clazz = clazz;
Expand All @@ -42,6 +44,7 @@ export class StandaloneInnerObjectProto implements EggPrototype {
this.injectObjects = [];
this.loadUnitId = loadUnitId;
this.qualifiers = qualifiers;
this.className = className;
}

verifyQualifiers(qualifiers: QualifierInfo[]): boolean {
Expand Down Expand Up @@ -73,9 +76,10 @@ export class StandaloneInnerObjectProto implements EggPrototype {
static create(ctx: EggPrototypeLifecycleContext): EggPrototype {
const { clazz, loadUnit } = ctx;
const name = ctx.prototypeInfo.name;
const className = ctx.prototypeInfo.className;
const id = IdenticalUtil.createProtoId(loadUnit.id, name);
const proto = new StandaloneInnerObjectProto(
id, name, clazz, ctx.prototypeInfo.initType, loadUnit.id, QualifierUtil.getProtoQualifiers(clazz),
id, name, clazz, ctx.prototypeInfo.initType, loadUnit.id, QualifierUtil.getProtoQualifiers(clazz), className,
);
return proto;
}
Expand Down

0 comments on commit 21c7fd2

Please sign in to comment.