| 2329 | type Intrinsic = (this: unknown, ...args: Array<any>) => any |
| 2330 | const getter = (proto: object, key: PropertyKey): Intrinsic => Object.getOwnPropertyDescriptor(proto, key)!.get! |
| 2331 | const hasSlot = (intrinsic: Intrinsic, u: object): boolean => { |
| 2332 | try { |
| 2333 | intrinsic.call(u) |
| 2334 | return true |
| 2335 | } catch { |
| 2336 | return false |
| 2337 | } |
| 2338 | } |
| 2339 | const typedArrayProto: object = Object.getPrototypeOf(Uint8Array.prototype) |
| 2340 | const typedArrayTag = getter(typedArrayProto, Symbol.toStringTag) |
| 2341 | const typedArrayBuffer = getter(typedArrayProto, "buffer") |