diff options
| author | jmoenig <jens@moenig.org> | 2013-07-11 17:45:09 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-07-11 17:45:09 +0200 |
| commit | 5f88fc93bb9a21eb281c30a2fbd75623113dbafc (patch) | |
| tree | 0a4d841653026e73927c0bda7007df03bb0ef55c | |
| parent | eb8aef28c82d86f43ac16d80d5c3a1b6a39561ac (diff) | |
| download | snap-byow-5f88fc93bb9a21eb281c30a2fbd75623113dbafc.tar.gz snap-byow-5f88fc93bb9a21eb281c30a2fbd75623113dbafc.zip | |
preserve nested reporters in "kicked out" variadic inputs
instead of "swallowing" them.
also new: floor() function in monadic math reporter's drop-down
| -rw-r--r-- | blocks.js | 14 | ||||
| -rwxr-xr-x | history.txt | 2 | ||||
| -rw-r--r-- | lang-de.js | 4 | ||||
| -rw-r--r-- | locale.js | 4 | ||||
| -rw-r--r-- | threads.js | 5 |
5 files changed, 20 insertions, 9 deletions
@@ -412,7 +412,7 @@ SyntaxElementMorph.prototype.allEmptySlots = function () { SyntaxElementMorph.prototype.replaceInput = function (oldArg, newArg) { var scripts = this.parentThatIsA(ScriptsMorph), - replacement, + replacement = newArg, idx = this.children.indexOf(oldArg), nb; @@ -424,10 +424,13 @@ SyntaxElementMorph.prototype.replaceInput = function (oldArg, newArg) { newArg.parent.removeChild(newArg); } - if (oldArg instanceof MultiArgMorph && this.dynamicInputLabels) { - replacement = new ArgLabelMorph(newArg); - } else { - replacement = newArg; + if (oldArg instanceof MultiArgMorph) { + oldArg.inputs().forEach(function (inp) { // preserve nested reporters + oldArg.replaceInput(inp, new InputSlotMorph()); + }); + if (this.dynamicInputLabels) { + replacement = new ArgLabelMorph(newArg); + } } replacement.parent = this; @@ -969,6 +972,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) { false, { abs : ['abs'], + floor : ['floor'], sqrt : ['sqrt'], sin : ['sin'], cos : ['cos'], diff --git a/history.txt b/history.txt index 6140b94..1e04b7e 100755 --- a/history.txt +++ b/history.txt @@ -1803,3 +1803,5 @@ ______ 130711 ------ * Blocks: fixed occasional flickering in scripting areas (caused by deleted feedback morphs, a bug that surfaced in Chrome 28 on OSX and may be due to a possible Chrome GC issue) +* Blocks: preserve nested blocks in the scripting area when replacing a variadic input list with another input ("kick out" the nested blocks instead of "swallowing" them) +* Blocks, Threads: new floor() function in monadic math reporter's drop-down @@ -185,7 +185,7 @@ SnapTranslator.dict.de = { 'translator_e-mail': 'jens@moenig.org', // optional 'last_changed': - '2013-07-02', // this, too, will appear in the Translators tab + '2013-07-11', // this, too, will appear in the Translators tab // GUI // control bar: @@ -1176,6 +1176,8 @@ SnapTranslator.dict.de = { // math functions 'abs': 'Betrag', + 'floor': + 'Abgerundet', 'sqrt': 'Wurzel', 'sin': @@ -42,7 +42,7 @@ /*global modules, contains*/ -modules.locale = '2013-July-02'; +modules.locale = '2013-July-11'; // Global stuff @@ -149,7 +149,7 @@ SnapTranslator.dict.de = { 'translator_e-mail': 'jens@moenig.org', 'last_changed': - '2013-07-02' + '2013-07-11' }; SnapTranslator.dict.it = { @@ -83,7 +83,7 @@ ArgLabelMorph, localize*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2013-July-09'; +modules.threads = '2013-July-11'; var ThreadManager; var Process; @@ -1876,6 +1876,9 @@ Process.prototype.reportMonadic = function (fname, n) { case 'abs': result = Math.abs(x); break; + case 'floor': + result = Math.floor(x); + break; case 'sqrt': result = Math.sqrt(x); break; |
