| 227 | // and avoid memory leaks from the IE cloneNode bug. |
| 228 | // TODO remove this method as only used if `canDefineProperty` is false |
| 229 | function getIENodeHash(node: unknown): number | undefined { |
| 230 | // @ts-expect-error don't care |
| 231 | if (node && node.nodeType > 0) { |
| 232 | // @ts-expect-error don't care |
| 233 | switch (node.nodeType) { |
| 234 | case 1: // Element |
| 235 | // @ts-expect-error don't care |
| 236 | return node.uniqueID; |
| 237 | case 9: // Document |
| 238 | // @ts-expect-error don't care |
| 239 | return node.documentElement && node.documentElement.uniqueID; |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | function valueOf(obj: object): unknown { |
| 245 | return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' |