(target: T)
| 7 | readonly [Symbol.toStringTag] = "WeakRef"; |
| 8 | |
| 9 | constructor(target: T) { |
| 10 | if (typeof target !== "object" || target === null) { |
| 11 | throw new TypeError("WeakRef target must be an object."); |
| 12 | } |
| 13 | this.target = target; |
| 14 | this.targetMap.set(this, target); |
| 15 | } |
| 16 | |
| 17 | deref(): T | undefined { |
| 18 | const target = this.targetMap.get(this); |