| 31 | 'This would leak it to the client.'; |
| 32 | |
| 33 | function cleanup(entryValue: string | bigint): void { |
| 34 | const entry = TaintRegistryValues.get(entryValue); |
| 35 | if (entry !== undefined) { |
| 36 | TaintRegistryPendingRequests.forEach(function (requestQueue) { |
| 37 | requestQueue.push(entryValue); |
| 38 | entry.count++; |
| 39 | }); |
| 40 | if (entry.count === 1) { |
| 41 | TaintRegistryValues.delete(entryValue); |
| 42 | } else { |
| 43 | entry.count--; |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | // If FinalizationRegistry doesn't exist, we assume that objects life forever. |
| 49 | // E.g. the whole VM is just the lifetime of a request. |