refactored reportOr()

pull/95/head
jmoenig 2020-05-24 14:04:30 +02:00
rodzic 257c5d23a3
commit 06db4ea86e
1 zmienionych plików z 11 dodań i 15 usunięć

Wyświetl plik

@ -788,24 +788,20 @@ Process.prototype.reportOr = function (block) {
if (inputs.length < 1) {
this.evaluateNextInput(block);
} else {
if (inputs.length === 1) {
this.assertType(inputs[0], 'Boolean');
if (inputs[0]) {
if (this.flashContext()) {return; }
this.returnValueToParentContext(true);
this.popContext();
return;
}
}
if (inputs.length < 2) {
this.evaluateNextInput(block);
} else {
this.assertType(inputs[1], 'Boolean');
} else if (inputs.length === 1) {
this.assertType(inputs[0], 'Boolean');
if (inputs[0]) {
if (this.flashContext()) {return; }
this.returnValueToParentContext(inputs[1] === true);
this.returnValueToParentContext(true);
this.popContext();
} else {
this.evaluateNextInput(block);
}
} else {
this.assertType(inputs[1], 'Boolean');
if (this.flashContext()) {return; }
this.returnValueToParentContext(inputs[1] === true);
this.popContext();
}
};