Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// currently rendering roots, a new root was added and will
// be processed by the existing _renderRoots invocation
return;
}
// used to prevent calling _renderRoots again (see above)
// while we are actively rendering roots
this._isRenderingRoots = true;
let completedWithoutError = false;
try {
this._renderRoots();
completedWithoutError = true;
} finally {
if (!completedWithoutError) {
this._lastRevision = CURRENT_TAG.value();
if (this._env.inTransaction === true) {
this._env.commit();
}
}
this._isRenderingRoots = false;
}
}
// when processing non-initial reflush loops,
// do not process more roots than needed
if (i >= initialRootsLength && !shouldReflush) {
continue;
}
root.options.alwaysRevalidate = shouldReflush;
// track shouldReflush based on this roots render result
shouldReflush = root.shouldReflush = runInTransaction(root, 'render');
// globalShouldReflush should be `true` if *any* of
// the roots need to reflush
globalShouldReflush = globalShouldReflush || shouldReflush;
}
this._lastRevision = CURRENT_TAG.value();
env.commit();
} while (globalShouldReflush || roots.length > initialRootsLength);
// remove any roots that were destroyed during this transaction
while (removedRoots.length) {
let root = removedRoots.pop();
let rootIndex = roots.indexOf(root);
roots.splice(rootIndex, 1);
}
if (this._roots.length === 0) {
deregister(this);
}
}