diff options
author | 2021-11-08 15:49:28 -0800 | |
---|---|---|
committer | 2021-11-08 15:49:28 -0800 | |
commit | 7a836382b3ca96f7b0d2f94db4d1431949c4d24a (patch) | |
tree | 3fd81dfd8347a0db57951a7cc6b21586f84a6a47 /packages/bun-framework-next/client.development.tsx | |
parent | 360dec4fb978b780bd6ef764f6d65977743e1b42 (diff) | |
download | bun-7a836382b3ca96f7b0d2f94db4d1431949c4d24a.tar.gz bun-7a836382b3ca96f7b0d2f94db4d1431949c4d24a.tar.zst bun-7a836382b3ca96f7b0d2f94db4d1431949c4d24a.zip |
[bun-framework-next] Use WeakSet for slightly better perf
Diffstat (limited to 'packages/bun-framework-next/client.development.tsx')
-rw-r--r-- | packages/bun-framework-next/client.development.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/bun-framework-next/client.development.tsx b/packages/bun-framework-next/client.development.tsx index d959b5ae1..5f25619ce 100644 --- a/packages/bun-framework-next/client.development.tsx +++ b/packages/bun-framework-next/client.development.tsx @@ -4,10 +4,11 @@ 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 -const freezer = new WeakMap(); +const freezer = new WeakSet(); globalThis.Object.freeze = function freeze(obj) { - freezer.set(freezer, true); + freezer.add(obj); + return obj; }; globalThis.Object.isFrozen = function isFrozen(obj) { |