(value)
| 3660 | } |
| 3661 | |
| 3662 | function fullObjectGraph(value) { |
| 3663 | const graph = new Set([value]); |
| 3664 | |
| 3665 | for (const entry of graph) { |
| 3666 | if ((typeof entry !== 'object' && typeof entry !== 'function') || |
| 3667 | entry === null) { |
| 3668 | continue; |
| 3669 | } |
| 3670 | |
| 3671 | graph.add(Object.getPrototypeOf(entry)); |
| 3672 | const descriptors = Object.values( |
| 3673 | Object.getOwnPropertyDescriptors(entry)); |
| 3674 | for (const descriptor of descriptors) { |
| 3675 | graph.add(descriptor.value); |
| 3676 | graph.add(descriptor.set); |
| 3677 | graph.add(descriptor.get); |
| 3678 | } |
| 3679 | } |
| 3680 | |
| 3681 | return graph; |
| 3682 | } |
| 3683 | |
| 3684 | // Consistency check. |
| 3685 | assert(fullObjectGraph(globalThis).has(Function.prototype)); |
no test coverage detected
searching dependent graphs…