// Polyfills for Hermes runtime compatibility with @atproto/oauth-client-expo // Must run before any atproto modules are imported // TC39 Explicit Resource Management (DisposableStack, Symbol.dispose, etc.) require("core-js/proposals/explicit-resource-management"); // AbortSignal.prototype.throwIfAborted if (typeof AbortSignal.prototype.throwIfAborted !== "function") { AbortSignal.prototype.throwIfAborted = function () { if (this.aborted) { throw this.reason ?? new Error("AbortError"); } }; } // AbortSignal.timeout if (typeof AbortSignal.timeout !== "function") { AbortSignal.timeout = (ms: number) => { const controller = new AbortController(); setTimeout(() => { const err = new Error("TimeoutError"); err.name = "TimeoutError"; controller.abort(err); }, ms); return controller.signal; }; }