# promise

Locked, prototype-pollution-resistant copy of the global `Promise` constructor and its statics.

The `Promise` constructor is wrapped in a [`createPromise`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/#api-createPromise) factory and its statics ([`resolve`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/#api-Promise), [`reject`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/#api-Promise), [`all`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/#api-Promise), [`race`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/#api-Promise), [`allSettled`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/#api-Promise), `any`, [`withResolvers`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/#api-Promise)) are captured at module-load time and frozen into a tamper-proof namespace, so async control flow keeps working even if the global `Promise` is later patched. Effective only when imported before any untrusted code has had a chance to mutate the prototype chain.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise/
This file: https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/promise.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
