diff --git a/src/platform/polyfills.ts b/src/platform/polyfills.ts index 1af3341..6bbf700 100644 --- a/src/platform/polyfills.ts +++ b/src/platform/polyfills.ts @@ -22,7 +22,7 @@ if (typeof Promise.withResolvers === "undefined") { // Promise.withResolvers is generic and works with subclasses - the typescript built-in decl // could not handle the subclassing case. - Promise.withResolvers = function (this: AnyPromiseConstructor) { + (Promise.prototype as any).withResolvers = function (this: AnyPromiseConstructor) { let resolve!: PromiseWithResolvers["resolve"], reject!: PromiseWithResolvers["reject"]; // These variables are expected to be set after `new this()`