Why does Babel generate a switch statement with an assignment in the condition?

Similar question, didn’t answer this though.

Got some code generated in a React callback:

    return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.async(function _callee2$(_context3) {
      while (1) {
        switch (_context3.prev = _context3.next) { // <<<<<----- this
          case 0:
            if (!(fileState.generationComplete || fileState.error || !fileState.generationInProgress)) {
              _context3.next = 2;
              break;
            }

I just can’t see any advantage to putting an assignment in a switch: switch (_context3.prev = _context3.next). I get that you’d want to set the prev to the next at the beginning of a loop but why do that in a switch?

Never seen this discussed before and it just seems odd to me.