| 569 | } |
| 570 | |
| 571 | getCont<S extends successCont | failureCont>( |
| 572 | symbol: S |
| 573 | ): Primitive & Record<S, (value: any, fiber: MicroFiberImpl) => Primitive> | undefined { |
| 574 | while (true) { |
| 575 | const op = this._stack.pop() |
| 576 | if (!op) return undefined |
| 577 | const cont = op[ensureCont] && op[ensureCont](this) |
| 578 | if (cont) return { [symbol]: cont } as any |
| 579 | if (op[symbol]) return op as any |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | // cancel the yielded operation, or for the yielded exit value |
| 584 | _yielded: MicroExit<any, any> | (() => void) | undefined = undefined |