mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Use |0 to coerce to number (#14297)
This commit is contained in:
@@ -56,12 +56,11 @@ export function validateContextBounds(
|
||||
context: ReactContext<any>,
|
||||
threadID: ThreadID,
|
||||
) {
|
||||
// If `react` package is < 16.6, _threadCount is undefined.
|
||||
let initialThreadCount = context._threadCount || 0;
|
||||
// If we don't have enough slots in this context to store this threadID,
|
||||
// fill it in without leaving any holes to ensure that the VM optimizes
|
||||
// this as non-holey index properties.
|
||||
for (let i = initialThreadCount; i <= threadID; i++) {
|
||||
// (Note: If `react` package is < 16.6, _threadCount is undefined.)
|
||||
for (let i = context._threadCount | 0; i <= threadID; i++) {
|
||||
// We assume that this is the same as the defaultValue which might not be
|
||||
// true if we're rendering inside a secondary renderer but they are
|
||||
// secondary because these use cases are very rare.
|
||||
|
||||
Reference in New Issue
Block a user