From 97bfc9035117c519cd5092ff2de8f7a045406d10 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Wed, 10 May 2017 11:22:03 -0400 Subject: [PATCH] add comment to monitor block listener filtering of events --- src/virtual-machine.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/virtual-machine.js b/src/virtual-machine.js index c56e289c0..b39d74d8a 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -350,6 +350,8 @@ class VirtualMachine extends EventEmitter { * @param {!Blockly.Event} e Any Blockly event. */ monitorBlockListener (e) { + // Filter events by type, since monitor blocks only need to listen to these events. + // Monitor blocks shouldn't be destroyed when flyout blocks are deleted. if (['create', 'change'].indexOf(e.type) !== -1) { this.runtime.monitorBlocks.blocklyListen(e, this.runtime); }