From f7aafe4d9c513523a6c73f32a4450d5ae34e8690 Mon Sep 17 00:00:00 2001 From: Andrew Sliwinski Date: Wed, 11 Jul 2018 13:14:01 -0400 Subject: [PATCH] Add opcode implementation for `data_deletealloflist` --- src/blocks/scratch3_data.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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(