kopia lustrzana https://github.com/backface/turtlestitch
fixed FOR so it can take numbers entered as text
bug report by Kathy from Piazzapull/89/head
rodzic
d96b234c63
commit
40c416a121
|
|
@ -7,6 +7,7 @@
|
|||
* optimized performance for sprite rendering and rotation
|
||||
* added support for counting down using the "numbers" reporter
|
||||
* **Notable Fixes:**
|
||||
* fixed FOR so it can take numbers entered as text (bug report by Kathy from Piazza)
|
||||
* removed "current" option from "switch to costume" block's drop-down menu
|
||||
* **Translation Updates:**
|
||||
|
||||
|
|
@ -14,6 +15,7 @@
|
|||
* threads: added support for counting down using the "numbers" reporter
|
||||
* morphic: improved canvas recycling
|
||||
* objects: optimized sprite rendering and rotating
|
||||
* threads: FOR so it can take numbers entered as text (bug report by Kathy from Piazza)
|
||||
|
||||
### 2019-10-28
|
||||
* new dev version
|
||||
|
|
|
|||
|
|
@ -2220,15 +2220,17 @@ Process.prototype.doFor = function (upvar, start, end, script) {
|
|||
var vars = this.context.outerContext.variables,
|
||||
dta = this.context.accumulator;
|
||||
if (dta === null) {
|
||||
this.assertType(+start, 'number');
|
||||
this.assertType(+end, 'number');
|
||||
dta = this.context.accumulator = {
|
||||
test : start < end ?
|
||||
function () {return vars.getVar(upvar) > end; }
|
||||
: function () {return vars.getVar(upvar) < end; },
|
||||
step : start < end ? 1 : -1,
|
||||
test : +start < +end ?
|
||||
function () {return vars.getVar(upvar) > +end; }
|
||||
: function () {return vars.getVar(upvar) < +end; },
|
||||
step : +start < +end ? 1 : -1,
|
||||
parms : new List() // empty parameters, reusable to avoid GC
|
||||
};
|
||||
vars.addVar(upvar);
|
||||
vars.setVar(upvar, Math.floor(start));
|
||||
vars.setVar(upvar, Math.floor(+start));
|
||||
} else {
|
||||
vars.changeVar(upvar, dta.step);
|
||||
}
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue