From c2b49602537fa5a13dba9c119fe8d0eef1a46bc2 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 20 Dec 2021 12:00:52 +0100 Subject: [PATCH] preserve embedded inputs when JOINing a nested expression with an empty list --- HISTORY.md | 4 ++++ snap.html | 4 ++-- src/blocks.js | 6 +++++- src/threads.js | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index e6bff3be..cdf1cd79 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,9 +6,13 @@ * **Notable Changes:** * **Notable Fixes:** * setting a clone's rotation coordinates shadows its inherited costumes + * preserve embedded inputs when JOINing a nested expression with an empty list * **Documentation Updates:** * **Translation Updates:** +### 2021-12-20 +* blocks, threads: preserve embedded inputs when JOINing a nested expression with an empty list + ### 2021-12-18 * new dev version * objects: shadow (a clone's) costumes when setting its rotation coordinates diff --git a/snap.html b/snap.html index f1081e8f..eb3d85a1 100755 --- a/snap.html +++ b/snap.html @@ -16,8 +16,8 @@ - - + + diff --git a/src/blocks.js b/src/blocks.js index 897e8844..bf7fa736 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -160,7 +160,7 @@ CustomCommandBlockMorph, ToggleButtonMorph, DialMorph, SnapExtensions*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2021-December-09'; +modules.blocks = '2021-December-20'; var SyntaxElementMorph; var BlockMorph; @@ -3826,6 +3826,10 @@ BlockMorph.prototype.copyWithInputs = function (inputs) { count = 0, dflt; + if (dta.length === 0) { + return cpy.reify(); + } + // restore input slots slots.forEach(slt => { if (slt instanceof BlockMorph) { diff --git a/src/threads.js b/src/threads.js index a7f84f76..3bd243bd 100644 --- a/src/threads.js +++ b/src/threads.js @@ -64,7 +64,7 @@ SnapExtensions, AlignmentMorph, TextMorph, Cloud, HatBlockMorph*/ /*jshint esversion: 6*/ -modules.threads = '2021-December-15'; +modules.threads = '2021-December-20'; var ThreadManager; var Process; @@ -7157,7 +7157,7 @@ Context.prototype.equalTo = function (other) { Context.prototype.copyWithInputs = function (inputs) { return this.expression ? - this.expression.copyWithInputs(inputs, this.inputs.slice()) + this.expression.copyWithInputs(inputs) : this; };