(stop)
| 96 | } |
| 97 | |
| 98 | function evictStackUpTo(stop) { |
| 99 | let total = 0; |
| 100 | // Search up the stack for things that need to be ejected in their entirety |
| 101 | // and save them |
| 102 | while (stackStates.length > 0 && stackStates.at(-1).stop < stop) { |
| 103 | total += stackStates.pop()._save(); |
| 104 | } |
| 105 | // Part of one more object may need to be ejected. |
| 106 | const last = stackStates.at(-1); |
| 107 | if (last && last.stop !== stop) { |
| 108 | total += last._save_up_to(stop); |
| 109 | } |
| 110 | // If we just saved all of the last stackState it needs to be removed. |
| 111 | // Alternatively, the current StackState may be on the stackStates list. |
| 112 | // Technically it would make sense to leave it there, but we will add it |
| 113 | // back if we suspend again and if we exit normally it gets removed from the |
| 114 | // stack. |
| 115 | if (last && last.stop === stop) { |
| 116 | stackStates.pop(); |
| 117 | } |
| 118 | return total; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * A class to help us keep track of the argument stack data for our individual |
no test coverage detected
searching dependent graphs…