kopia lustrzana https://github.com/backface/turtlestitch
removed old hyper-if experiments
rodzic
e1e72d10c4
commit
06e4662aa5
|
@ -2367,52 +2367,6 @@ Process.prototype.reportIfElse = function (block) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
// Process - hyperized reporter-if, experimental, commented out for now
|
|
||||||
|
|
||||||
Process.prototype.reportIfElse = function (block) {
|
|
||||||
var inputs = this.context.inputs;
|
|
||||||
|
|
||||||
if (inputs.length < 1) {
|
|
||||||
this.evaluateNextInput(block);
|
|
||||||
} else if (inputs.length > 1) {
|
|
||||||
if (this.flashContext()) {return; }
|
|
||||||
if (inputs[0] instanceof List && this.enableHyperOps) {
|
|
||||||
if (inputs.length < 3) {
|
|
||||||
this.evaluateNextInput(block);
|
|
||||||
} else {
|
|
||||||
this.returnValueToParentContext(
|
|
||||||
this.hyperIf.apply(this, inputs)
|
|
||||||
);
|
|
||||||
this.popContext();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.returnValueToParentContext(inputs.pop());
|
|
||||||
this.popContext();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (inputs[0] instanceof List && this.enableHyperOps) {
|
|
||||||
this.evaluateNextInput(block);
|
|
||||||
} else {
|
|
||||||
// this.assertType(inputs[0], ['Boolean']);
|
|
||||||
if (inputs[0]) {
|
|
||||||
this.evaluateNextInput(block);
|
|
||||||
} else {
|
|
||||||
inputs.push(null);
|
|
||||||
this.evaluateNextInput(block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Process.prototype.hyperIf = function (test, trueValue, falseValue) {
|
|
||||||
if (test instanceof List) {
|
|
||||||
return test.map(each => this.hyperIf(each, trueValue, falseValue));
|
|
||||||
}
|
|
||||||
return test ? trueValue : falseValue;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Process process related primitives
|
// Process process related primitives
|
||||||
|
|
||||||
Process.prototype.doStop = function () {
|
Process.prototype.doStop = function () {
|
||||||
|
|
Ładowanie…
Reference in New Issue