React 污点注册表
export interface Reference {}
export type TaintEntry = {
message: string;
count: number;
};
export const TaintRegistryObjects: WeakMap<Reference, string> = new WeakMap();
export const TaintRegistryValues: Map<string | bigint, TaintEntry> = new Map();
// Byte lengths of all binary values we've ever seen. We don't both refcounting this.
// We expect to see only a few lengths here such as the length of token.
//
// 我们见过的所有二进制值的字节长度。我们不对它进行引用计数。
// 我们预计这里只会出现几个长度,例如 token 的长度。
export const TaintRegistryByteLengths: Set<number> = new Set();
// When a value is finalized, it means that it has been removed from any global caches.
// No future requests can get a handle on it but any ongoing requests can still have
// a handle on it. It's still tainted until that happens.
//
// 当一个值被最终确定时,意味着它已从任何全局缓存中移除。将来的请求无法获取它的引用,但任何正在进行的请求
// 仍然可以引用它。在此之前,它仍然是受污染的。
export type RequestCleanupQueue = Array<string | bigint>;
export const TaintRegistryPendingRequests: Set<RequestCleanupQueue> = new Set();