Skip to content

Commit dc0dd4b

Browse files
authored
Use |0 to coerce to number (facebook#14297)
1 parent dd8205c commit dc0dd4b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/react-dom/src/server/ReactPartialRendererContext.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ export function validateContextBounds(
5656
context: ReactContext<any>,
5757
threadID: ThreadID,
5858
) {
59-
// If `react` package is < 16.6, _threadCount is undefined.
60-
let initialThreadCount = context._threadCount || 0;
6159
// If we don't have enough slots in this context to store this threadID,
6260
// fill it in without leaving any holes to ensure that the VM optimizes
6361
// this as non-holey index properties.
64-
for (let i = initialThreadCount; i <= threadID; i++) {
62+
// (Note: If `react` package is < 16.6, _threadCount is undefined.)
63+
for (let i = context._threadCount | 0; i <= threadID; i++) {
6564
// We assume that this is the same as the defaultValue which might not be
6665
// true if we're rendering inside a secondary renderer but they are
6766
// secondary because these use cases are very rare.

0 commit comments

Comments
 (0)