Skip to content

Commit

Permalink
deprecated "expand (input) to (n) slots" command, because "set slot .…
Browse files Browse the repository at this point in the history
….. to ..." can now do this by passing a list as value
  • Loading branch information
jmoenig committed Nov 9, 2024
1 parent 2d77f50 commit 8e90e24
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Snap! (BYOB) History

## in development:
* **Notable Changes:**
* deprecated "expand (input) to (n) slots" command, because "set slot ... to ..." can now do this by passing a list as value

### 2024-11-09
* threads: enhanced "set slot ... to ..." command to also handle variadic inputs, setting them to a list of values
* threads, objects: deprecated "expand (input) to (n) slots" command, because "set slot ... to ..." can now do this by passing a list as value

## 10.2.0:
* **New Features:**
Expand Down
2 changes: 1 addition & 1 deletion snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script src="src/widgets.js?version=2024-07-24"></script>
<script src="src/blocks.js?version=2024-11-08"></script>
<script src="src/threads.js?version=2024-11-09"></script>
<script src="src/objects.js?version=2024-11-07"></script>
<script src="src/objects.js?version=2024-11-09"></script>
<script src="src/scenes.js?version=2024-05-28"></script>
<script src="src/gui.js?version=2024-11-08"></script>
<script src="src/paint.js?version=2023-05-24"></script>
Expand Down
8 changes: 4 additions & 4 deletions src/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ CustomBlockDefinition, exportEmbroidery*/

/*jshint esversion: 11*/

modules.objects = '2024-November-07';
modules.objects = '2024-November-09';

var SpriteMorph;
var StageMorph;
Expand Down Expand Up @@ -1367,7 +1367,7 @@ SpriteMorph.prototype.primitiveBlocks = function () {
category: 'control',
spec: 'set slot %inputSlot to %s'
},
doExpandSlot: {
doExpandSlot: { // deprecated, kept for backwards compatibility
type: 'command',
category: 'control',
spec: 'expand %variadicSlot to %n slots'
Expand Down Expand Up @@ -3738,7 +3738,7 @@ SpriteMorph.prototype.blockTemplates = function (
blocks.push(block('receiveMenuRequest'));
blocks.push(block('receiveSlotEdit'));
blocks.push(block('doSetSlot'));
blocks.push(block('doExpandSlot'));
// blocks.push(block('doExpandSlot')); // deprecated in v10.2.1

// for debugging: ///////////////
if (devMode) {
Expand Down Expand Up @@ -10918,7 +10918,7 @@ StageMorph.prototype.blockTemplates = function (
blocks.push(block('receiveMenuRequest'));
blocks.push(block('receiveSlotEdit'));
blocks.push(block('doSetSlot'));
blocks.push(block('doExpandSlot'));
// blocks.push(block('doExpandSlot')); // deprecated in v10.2.1

// for debugging: ///////////////
if (this.world().isDevMode) {
Expand Down
2 changes: 2 additions & 0 deletions src/threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,8 @@ Process.prototype.doSetSlot = function(name, value) {
};

Process.prototype.doExpandSlot = function(name, arity) {
// deprecated b/c superseded by doSetSlot(),
// kept for backwards compatibility with v10.2.0
var sym = Symbol.for('block'),
frame, block, slot;
if (!name) {return; }
Expand Down

0 comments on commit 8e90e24

Please sign in to comment.