@param {T} value
(value)
| 117 | |
| 118 | /** @param {T} value */ |
| 119 | has(value) { |
| 120 | var has = super.has(value); |
| 121 | var sources = this.#sources; |
| 122 | var s = sources.get(value); |
| 123 | |
| 124 | if (s === undefined) { |
| 125 | if (!has) { |
| 126 | // If the value doesn't exist, track the version in case it's added later |
| 127 | // but don't create sources willy-nilly to track all possible values |
| 128 | get(this.#version); |
| 129 | return false; |
| 130 | } |
| 131 | |
| 132 | s = this.#source(true); |
| 133 | |
| 134 | if (DEV) { |
| 135 | tag(s, `SvelteSet has(${label(value)})`); |
| 136 | } |
| 137 | |
| 138 | sources.set(value, s); |
| 139 | } |
| 140 | |
| 141 | get(s); |
| 142 | return has; |
| 143 | } |
| 144 | |
| 145 | /** @param {T} value */ |
| 146 | add(value) { |