Skip to content

Commit

Permalink
add globalThis binding for cloud worker scenarios #810 (#811)
Browse files Browse the repository at this point in the history
* test globalThis binding

* eslint escape
  • Loading branch information
glharper authored Apr 18, 2024
1 parent 333f0b8 commit e89846a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common.speech/ServiceRecognizerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ export abstract class ServiceRecognizerBase implements IDisposable {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.privSetTimeout = window.setTimeout.bind(window);
}
if (typeof globalThis !== "undefined") {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.privSetTimeout = globalThis.setTimeout.bind(globalThis);
}
}

this.connectionEvents.attach((connectionEvent: ConnectionEvent): void => {
Expand Down

0 comments on commit e89846a

Please sign in to comment.