Skip to content

Commit

Permalink
fix(ses): dont use native hardener which doesnt suppressTrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 3, 2025
1 parent e02b0f6 commit 528a9c4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/ses/src/make-hardener.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,14 @@ const freezeTypedArray = array => {
* @returns {Harden}
*/
export const makeHardener = () => {
// Use a native hardener if possible.
if (typeof globalThis.harden === 'function') {
const safeHarden = globalThis.harden;
return safeHarden;
}
// TODO Get the native hardener to suppressTrapping at each step,
// rather than freeze. Until then, it is *expensive*!
//
// // Use a native hardener if possible.
// if (typeof globalThis.harden === 'function') {
// const safeHarden = globalThis.harden;
// return safeHarden;
// }

const hardened = new WeakSet();

Expand Down

0 comments on commit 528a9c4

Please sign in to comment.