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