* @param {any} val * @param {string} [path]
(val, path= undefined)
| 2058 | * @param {string} [path] |
| 2059 | */ |
| 2060 | function enqueue(val, path= undefined) { |
| 2061 | if( !isObject(val)) { |
| 2062 | // ignore primitives |
| 2063 | return; |
| 2064 | } |
| 2065 | const type= typeof val; |
| 2066 | if( type!== 'object'&& type!== 'function') { |
| 2067 | // future proof: break until someone figures out what it should do |
| 2068 | throw TypeError( `Unexpected typeof: ${type}`); |
| 2069 | } |
| 2070 | if( weaksetHas(hardened, val)|| setHas(toFreeze, val)) { |
| 2071 | // Ignore if this is an exit, or we've already visited it |
| 2072 | return; |
| 2073 | } |
| 2074 | // console.warn(`adding ${val} to toFreeze`, val); |
| 2075 | setAdd(toFreeze, val); |
| 2076 | weakmapSet(paths, val, path); |
| 2077 | } |
| 2078 | |
| 2079 | /** |
| 2080 | * @param {any} obj |
no test coverage detected