From 2fd931cab99f325150eefb87233766ebea672c40 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 6 Nov 2018 11:54:54 -0800 Subject: [PATCH] Add comment regarding async nature of listening. --- core/workspace.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/workspace.js b/core/workspace.js index 36818614a..f8a7739bd 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -618,6 +618,9 @@ Blockly.Workspace.prototype.clearUndo = function() { /** * When something in this workspace changes, call a function. + * Note that there may be a few recent events already on the stack. Thus the + * new change listener might be called with events that occurred a few + * milliseconds before the change listener was added. * @param {!Function} func Function to call. * @return {!Function} Function that can be passed to * removeChangeListener.