(cursor: StackCursor<T>, fiber: Fiber)
| 28 | } |
| 29 | |
| 30 | function pop<T>(cursor: StackCursor<T>, fiber: Fiber): void { |
| 31 | if (index < 0) { |
| 32 | if (__DEV__) { |
| 33 | console.error('Unexpected pop.'); |
| 34 | } |
| 35 | return; |
| 36 | } |
| 37 | |
| 38 | if (__DEV__) { |
| 39 | if (fiber !== fiberStack[index]) { |
| 40 | console.error('Unexpected Fiber popped.'); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | cursor.current = valueStack[index]; |
| 45 | |
| 46 | valueStack[index] = null; |
| 47 | |
| 48 | if (__DEV__) { |
| 49 | fiberStack[index] = null; |
| 50 | } |
| 51 | |
| 52 | index--; |
| 53 | } |
| 54 | |
| 55 | function push<T>(cursor: StackCursor<T>, value: T, fiber: Fiber): void { |
| 56 | index++; |
no test coverage detected