ESM: Tidied up FlowControl ops

This commit is contained in:
n1474335 2018-05-21 11:39:10 +00:00
parent 1472f82205
commit 28b24b725f
9 changed files with 6 additions and 34 deletions

View file

@ -50,8 +50,6 @@ class ConditionalJump extends Operation {
}
/**
* Conditional Jump operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
@ -62,10 +60,7 @@ class ConditionalJump extends Operation {
async run(state) {
const ings = state.opList[state.progress].ingValues,
dish = state.dish,
regexStr = ings[0],
invert = ings[1],
label = ings[2],
maxJumps = ings[3],
[regexStr, invert, label, maxJumps] = ings,
jmpIndex = getLabelIndex(label, state);
if (state.numJumps >= maxJumps || jmpIndex === -1) {