Skip to content

Commit

Permalink
y
Browse files Browse the repository at this point in the history
  • Loading branch information
Delusoire committed Aug 29, 2024
1 parent 28b842c commit 4a4f89c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export class ModuleInstance extends ModuleInstanceBase<Module>
return this.canLoadRecur(false);
}

private canLoadRecur(isPreload: boolean, range = parseRange("")) {
private canLoadRecur(isPreload: boolean, range?: string | undefined) {
if (this.isLoaded()) {
return true;
}
Expand All @@ -607,7 +607,7 @@ export class ModuleInstance extends ModuleInstanceBase<Module>
if (!isPreload && !this.mixinsLoaded && this.metadata.hasMixins) {
throw `can't load \`${this.getModuleIdentifier()}\` because it has unloaded mixins`;
}
if (!this.canLoad() || !satisfies(parse(this.version), range)) {
if (!this.canLoad() || (range && !satisfies(parse(this.version), parseRange(range)))) {
throw `can't load \`${this.getModuleIdentifier()}\` because it is not enabled, installed, or satisfies the range \`${range}\``;
}

Expand All @@ -616,7 +616,7 @@ export class ModuleInstance extends ModuleInstanceBase<Module>
) {
const module = RootModule.INSTANCE.getDescendant(dependency)
?.getEnabledInstance();
if (!module?.canLoadRecur(isPreload, parseRange(range))) {
if (!module?.canLoadRecur(isPreload, range)) {
return false;
}
}
Expand Down

0 comments on commit 4a4f89c

Please sign in to comment.