/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react/src/ReactTaintRegistry.js
27 строк
1 KB
Sebastian Markbåge
Flatten ReactSharedInternals (#28783)
09 апр 2024, 02:23
Не верифицирован
09 апр 2024, 02:23
d50323e
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ 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. 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();