diff --git a/history.txt b/history.txt index b53e59ca..e30cb009 100755 --- a/history.txt +++ b/history.txt @@ -2476,3 +2476,7 @@ ______ ------ * Store: fixed #743 * GUI, html: switch from beta to release candidate + +150325 +------ +* Threads: fixed #752 diff --git a/threads.js b/threads.js index 50af8dde..7100aa6e 100644 --- a/threads.js +++ b/threads.js @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2015-February-28'; +modules.threads = '2015-March-25'; var ThreadManager; var Process; @@ -1153,13 +1153,16 @@ Process.prototype.doDeclareVariables = function (varNames) { Process.prototype.doSetVar = function (varName, value) { var varFrame = this.context.variables, name = varName; - if (name instanceof Context) { if (name.expression.selector === 'reportGetVar') { - name = name.expression.blockSpec; + name.variables.setVar( + name.expression.blockSpec, + value + ); + return; } } - varFrame.setVar(name, value); + varFrame.setVar(name, value, this.blockReceiver()); }; Process.prototype.doChangeVar = function (varName, value) { @@ -1168,10 +1171,14 @@ Process.prototype.doChangeVar = function (varName, value) { if (name instanceof Context) { if (name.expression.selector === 'reportGetVar') { - name = name.expression.blockSpec; + name.variables.changeVar( + name.expression.blockSpec, + value + ); + return; } } - varFrame.changeVar(name, value); + varFrame.changeVar(name, value, this.blockReceiver()); }; Process.prototype.reportGetVar = function () { @@ -1323,6 +1330,8 @@ Process.prototype.doDeleteFromList = function (index, list) { } if (this.inputOption(index) === 'last') { idx = list.length(); + } else if (isNaN(+this.inputOption(index))) { + return null; } list.remove(idx); };