Skip to content

Commit

Permalink
Update primordials.js
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
  • Loading branch information
anonrig and aduh95 committed Oct 18, 2024
1 parent 8d2a7dc commit df1b7e5
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lib/internal/per_context/primordials.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,18 +739,5 @@ primordials.SafeStringPrototypeSearch = (str, regexp) => {
return match ? match.index : -1;
};

// TODO(@anonrig): Remove this when V8 removes the flag to disable Promise.withResolvers()
// eslint-disable-next-line node-core/prefer-primordials
primordials.PromiseWithResolvers = Promise.withResolvers || (() => {
let resolve;
let reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});

return { promise, resolve, reject };
});

ObjectSetPrototypeOf(primordials, null);
ObjectFreeze(primordials);

0 comments on commit df1b7e5

Please sign in to comment.