Skip to content

Commit

Permalink
Use |0 to coerce to number (facebook#14297)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored and n8schloss committed Jan 31, 2019
1 parent f893419 commit ea44388
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react-dom/src/server/ReactPartialRendererContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ea44388

Please sign in to comment.