From edaa97c286096f973bc6259383c7b86ee37c750b Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 14 Oct 2019 13:21:44 +0200 Subject: [PATCH] fixed MY PARTS so mutating the result list has no effect --- HISTORY.md | 2 ++ snap.html | 2 +- src/threads.js | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 7e33a841..0391b89d 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,7 @@ * typing strings into the search-field again shows relevant blocks (regression from IME) * fixed project dialog's search-field behevior (regression from IME) * morphic collision detection off-by-1 fix, thanks, Dariusz! + * fixed MY PARTS so mutating the result list has no effect * fixed a typo in the OF-reporter's help screen, thanks, @jasonappah * enable costumes created in the vector editor to be stretchable in Firefox, thanks, @coproc * **Translation Updates:** @@ -21,6 +22,7 @@ * morphic: new "reactToInput" text-editing event * objects: fixed #2485 (find blocks and text-entry mode feature) * gui: fixed ProjectDialog's search field behavior for IME +* threads: fixed MY PARTS so mutating the result list has no effect ### 2019-10-11 * objects, threads: accept a list of pixels in the SWITCH TO COSTUME block diff --git a/snap.html b/snap.html index 3ff66b10..1f7b6961 100755 --- a/snap.html +++ b/snap.html @@ -7,7 +7,7 @@ - + diff --git a/src/threads.js b/src/threads.js index 853a361a..d935a753 100644 --- a/src/threads.js +++ b/src/threads.js @@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, Color, TableFrameMorph, ColorSlotMorph, isSnapObject, Map, newCanvas, Symbol*/ -modules.threads = '2019-October-11'; +modules.threads = '2019-October-14'; var ThreadManager; var Process; @@ -4293,8 +4293,9 @@ Process.prototype.reportGet = function (query) { each !== thisObj; }) ); - case 'parts': - return new List(thisObj.parts || []); + case 'parts': // shallow copy to disable side-effects + return new List((thisObj.parts || []) + .map(function (each) {return each; })); case 'anchor': return thisObj.anchor || ''; case 'parent':