diff --git a/src/blocks/scratch3_data.js b/src/blocks/scratch3_data.js index cd56dcb32..9ebd3712c 100644 --- a/src/blocks/scratch3_data.js +++ b/src/blocks/scratch3_data.js @@ -23,6 +23,7 @@ class Scratch3DataBlocks { data_listcontents: this.getListContents, data_addtolist: this.addToList, data_deleteoflist: this.deleteOfList, + data_deletealloflist: this.deleteAllOfList, data_insertatlist: this.insertAtList, data_replaceitemoflist: this.replaceItemOfList, data_itemoflist: this.getItemOfList, @@ -136,6 +137,13 @@ class Scratch3DataBlocks { list._monitorUpToDate = false; } + deleteAllOfList (args, util) { + const list = util.target.lookupOrCreateList( + args.LIST.id, args.LIST.name); + list.value = []; + return; + } + insertAtList (args, util) { const item = args.ITEM; const list = util.target.lookupOrCreateList(