Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions packages/react-reconciler/src/ReactFiberStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ function createCursor<T>(defaultValue: T): StackCursor<T> {
};
}

function isEmpty(): boolean {
return index === -1;
}

function pop<T>(cursor: StackCursor<T>, fiber: Fiber): void {
if (index < 0) {
if (__DEV__) {
Expand Down Expand Up @@ -67,31 +63,4 @@ function push<T>(cursor: StackCursor<T>, value: T, fiber: Fiber): void {

cursor.current = value;
}

function checkThatStackIsEmpty() {
if (__DEV__) {
if (index !== -1) {
console.error(
'Expected an empty stack. Something was not reset properly.',
);
}
}
}

function resetStackAfterFatalErrorInDev() {
if (__DEV__) {
index = -1;
valueStack.length = 0;
fiberStack.length = 0;
}
}

export {
createCursor,
isEmpty,
pop,
push,
// DEV only:
checkThatStackIsEmpty,
resetStackAfterFatalErrorInDev,
};
export {createCursor, pop, push};
Loading