Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Delusoire committed Aug 13, 2024
1 parent e64e216 commit 309aa00
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,52 +155,6 @@ export abstract class ModuleBase<
}
}

export class RootModule extends ModuleBase<Module, never> {
override newInstance(): Promise<never> {
throw new Error("RootModule can't have instances");
}
public static INSTANCE = new RootModule();

private constructor() {
super(null, {}, "");
Object.freeze(this.instances);

const spotifyModule = new Module(
this,
{},
"Spotify",
SPOTIFY_VERSION,
);

const spotifyModuleInstance = new ModuleInstance(
spotifyModule,
SPOTIFY_VERSION,
null,
[],
"",
true,
true,
);

spotifyModuleInstance.forceLoad();

spotifyModule.instances.set(SPOTIFY_VERSION, spotifyModuleInstance);
}

override newDescendant(
identifier: ModuleIdentifier,
module: _Module,
local = false,
) {
return Module.prototype.newDescendant.call(
this,
identifier,
module,
local,
);
}
}

export class Module extends ModuleBase<Module, ModuleInstance> {
constructor(
parent: RootModule | Module,
Expand Down Expand Up @@ -967,6 +921,52 @@ export class ModuleInstance extends ModuleInstanceBase<Module>
}
}

export class RootModule extends ModuleBase<Module, never> {
override newInstance(): Promise<never> {
throw new Error("RootModule can't have instances");
}
public static INSTANCE = new RootModule();

private constructor() {
super(null, {}, "");
Object.freeze(this.instances);

const spotifyModule = new Module(
this,
{},
"Spotify",
SPOTIFY_VERSION,
);

const spotifyModuleInstance = new ModuleInstance(
spotifyModule,
SPOTIFY_VERSION,
null,
[],
"",
true,
true,
);

spotifyModuleInstance.forceLoad();

spotifyModule.instances.set(SPOTIFY_VERSION, spotifyModuleInstance);
}

override newDescendant(
identifier: ModuleIdentifier,
module: _Module,
local = false,
) {
return Module.prototype.newDescendant.call(
this,
identifier,
module,
local,
);
}
}

export const INTERNAL_MIXIN_LOADER: MixinLoader = {
awaitedMixins: [],
};
Expand Down

0 comments on commit 309aa00

Please sign in to comment.