diff options
author | 2021-11-08 15:42:30 -0800 | |
---|---|---|
committer | 2021-11-08 15:42:30 -0800 | |
commit | 83cf1be2b93bff3c11c88da4a6f50d6f932a1779 (patch) | |
tree | f3fadb7ca257a827f2ce8dedb2ae7f116a868382 /packages/bun-framework-next/client.development.tsx | |
parent | 76a99eaa18fc7ba9fc7c30c3122f96ab312def08 (diff) | |
download | bun-83cf1be2b93bff3c11c88da4a6f50d6f932a1779.tar.gz bun-83cf1be2b93bff3c11c88da4a6f50d6f932a1779.tar.zst bun-83cf1be2b93bff3c11c88da4a6f50d6f932a1779.zip |
tweak
Diffstat (limited to 'packages/bun-framework-next/client.development.tsx')
-rw-r--r-- | packages/bun-framework-next/client.development.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/bun-framework-next/client.development.tsx b/packages/bun-framework-next/client.development.tsx index 3921bf011..d959b5ae1 100644 --- a/packages/bun-framework-next/client.development.tsx +++ b/packages/bun-framework-next/client.development.tsx @@ -4,8 +4,14 @@ globalThis.Bun_disableCSSImports = true; // We're disabling Object.freeze because it breaks CJS => ESM and can cause // issues with Suspense and other things that expect the CJS module namespace // to be mutable when the ESM module namespace is NOT mutable -globalThis.Object.freeze = (obj) => { - return obj; +const freezer = new WeakMap(); + +globalThis.Object.freeze = function freeze(obj) { + freezer.set(freezer, true); +}; + +globalThis.Object.isFrozen = function isFrozen(obj) { + return freezer.has(obj); }; import * as React from "react"; |