Make hardener a non-constructor
MODIFY
packages/make-hardener/src/main.js
packages/make-hardener/src/main.js
@@ -63,7 +63,8 @@ function makeHardener(initialFringe, options = {}) {
const naivePrepareObject = options && options.naivePrepareObject;
- const harden = { harden(root) {
+ const { harden } = {
+ harden(root) {
const toFreeze = new Set();
const prototypes = new Map();
const paths = new WeakMap();
@@ -150,6 +151,7 @@ function makeHardener(initialFringe, options = {}) {
// all reachable properties have already been frozen by this point
let msg;
try {
+ debugger;
msg = `prototype ${p} of ${path} is not already in the fringeSet`;
} catch (e) {
// `${(async _=>_).__proto__}` fails in most engines
@@ -185,7 +187,8 @@ function makeHardener(initialFringe, options = {}) {
commit();
return root;
- }}.harden;
+ },
+ };
return harden;
}

Make hardener a non-constructor