diff --git a/HISTORY.md b/HISTORY.md index fc17ba02..e40ed39d 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -18,6 +18,7 @@ * new POSITION primitive reporter in the MOTION category * new MOUSE POSITION primitive reporter in the SENSING category * new "position" choice in OF reporter's attribute dropdown, reports a list of XY coordinates + * new "variables" choice in OF reporter's attribute dropdown, reports a list of reachable variable names * new "categories" choice in MY reporter's dropdown, reports an ordered list of all category names whose indices match the "category" reported elsewhere * new "label", "type", "scope", "slots", "defaults", "menus" and "editables" choices in the OF BLOCK block-attribute reporter's dropdown * new "set attribute of block" primitive @@ -67,6 +68,7 @@ * gui: added credits for Bambi * gui: added credits for Glen & team * gui: added credits for Meghan +* blocks, threads: new "variables" choice in OF reporter's attribute dropdown, reports a list of reachable variable names ### 2022-08-02 * cloud: update diff --git a/snap.html b/snap.html index afe7cd28..1642f107 100755 --- a/snap.html +++ b/snap.html @@ -16,8 +16,8 @@ - - + + diff --git a/src/blocks.js b/src/blocks.js index ee44f8f0..b9feaaff 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -161,7 +161,7 @@ CostumeIconMorph, SoundIconMorph, SVG_Costume, embedMetadataPNG*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2022-August-01'; +modules.blocks = '2022-August-03'; var SyntaxElementMorph; var BlockMorph; @@ -10602,10 +10602,11 @@ InputSlotMorph.prototype.attributesMenu = function (searching) { 'bottom' : ['bottom'] }; } + dict['~'] = null; + dict.variables = ['variables']; if (obj) { varNames = obj.variables.names(); if (varNames.length > 0) { - dict['~'] = null; varNames.forEach(name => dict[name] = name ); diff --git a/src/threads.js b/src/threads.js index 538e61af..6438e1e5 100644 --- a/src/threads.js +++ b/src/threads.js @@ -65,7 +65,7 @@ StagePickerMorph, CustomBlockDefinition*/ /*jshint esversion: 11, bitwise: false, evil: true*/ -modules.threads = '2022-August-01'; +modules.threads = '2022-August-03'; var ThreadManager; var Process; @@ -5658,12 +5658,14 @@ Process.prototype.reportBasicAttributeOf = function (attribute, name) { if (thisObj) { this.assertAlive(thisObj); stage = thisObj.parentThatIsA(StageMorph); - if (stage.name === name) { + if (name instanceof Context) { + thatObj = name; + } else if (stage.name === name) { thatObj = stage; } else { thatObj = this.getOtherObject(name, thisObj, stage); } - if (thatObj) { + if (isSnapObject(thatObj)) { this.assertAlive(thatObj); if (attribute instanceof BlockMorph) { // a "wish" return this.reportContextFor( @@ -5726,6 +5728,12 @@ Process.prototype.reportBasicAttributeOf = function (attribute, name) { return thatObj.yBottom(); } } + if (this.inputOption(attribute) === 'variables') { + return new List((thatObj instanceof Context ? + thatObj.outerContext + : thatObj).variables.allNames() + ); + } } return ''; };