Skip to content

Commit

Permalink
🐛 fix delay in resolving waitLoaded()
Browse files Browse the repository at this point in the history
This is a regression due to #418 and discovered by #419.
  • Loading branch information
Milly committed Sep 17, 2024
1 parent d3f43a2 commit ad5c642
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions denops/@denops-private/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,16 @@ export class Service implements HostService, AsyncDisposable {
}
}

async waitLoaded(name: string): Promise<void> {
if (this.#closed) {
throw new Error("Service closed");
waitLoaded(name: string): Promise<void> {
try {
if (this.#closed) {
throw new Error("Service closed");
}
assertValidPluginName(name);
} catch (e) {
return Promise.reject(e);
}
assertValidPluginName(name);
await this.#getWaiter(name).promise;
return this.#getWaiter(name).promise;
}

interrupt(reason?: unknown): void {
Expand Down

0 comments on commit ad5c642

Please sign in to comment.