Skip to content

Commit

Permalink
Fix polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Feb 12, 2024
1 parent 18f043e commit b4a83fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/promise-polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { AsyncContext } from "./index";
import type { AnyFunc } from "./types";

export const nativeThen = Promise.prototype.then;
const { wrap } = AsyncContext.Snapshot;

function wrapFn<F extends AnyFunc<any>>(fn: F | null | undefined) {
if (typeof fn !== "function") return undefined;
return AsyncContext.wrap(fn);
return wrap(fn);
}

export function then<T>(
Expand Down

0 comments on commit b4a83fa

Please sign in to comment.