(err, result)
| 576 | |
| 577 | let finished = false; |
| 578 | function finishExecution(err, result) { |
| 579 | if (finished) return; |
| 580 | finished = true; |
| 581 | |
| 582 | // After executing the current expression, store the values of RegExp |
| 583 | // predefined properties back in `savedRegExMatches` |
| 584 | for (let idx = 1; idx < savedRegExMatches.length; idx += 1) { |
| 585 | savedRegExMatches[idx] = RegExp[`$${idx}`]; |
| 586 | } |
| 587 | |
| 588 | cb(err, result); |
| 589 | } |
| 590 | |
| 591 | if (!err) { |
| 592 | // Unset raw mode during evaluation so that Ctrl+C raises a signal. |