More field dispose (#3201)

* Dispose of element references in fields.
* Fewer warnings
This commit is contained in:
Sam El-Husseini
2019-10-15 17:56:53 -05:00
committed by GitHub
parent e411077b9f
commit 2224bb2a4e
10 changed files with 308 additions and 85 deletions

View File

@@ -113,6 +113,13 @@ Blockly.clipboardTypeCounts_ = null;
*/
Blockly.cache3dSupported_ = null;
/**
* Blockly opaque event data used to unbind events when using
* `Blockly.bindEvent_` and `Blockly.bindEventWithChecks_`.
* @typedef {!Array.<!Array>}
*/
Blockly.EventData;
/**
* Returns the dimensions of the specified SVG image.
* @param {!Element} svg SVG image.
@@ -455,7 +462,7 @@ Blockly.defineBlocksWithJsonArray = function(jsonArray) {
* should prevent the default handler. False by default. If
* opt_noPreventDefault is provided, opt_noCaptureIdentifier must also be
* provided.
* @return {!Array.<!Array>} Opaque data that can be passed to unbindEvent_.
* @return {!Blockly.EventData} Opaque data that can be passed to unbindEvent_.
*/
Blockly.bindEventWithChecks_ = function(node, name, thisObject, func,
opt_noCaptureIdentifier, opt_noPreventDefault) {
@@ -521,7 +528,7 @@ Blockly.bindEventWithChecks_ = function(node, name, thisObject, func,
* @param {string} name Event name to listen to (e.g. 'mousedown').
* @param {Object} thisObject The value of 'this' in the function.
* @param {!Function} func Function to call when event is triggered.
* @return {!Array.<!Array>} Opaque data that can be passed to unbindEvent_.
* @return {!Blockly.EventData} Opaque data that can be passed to unbindEvent_.
*/
Blockly.bindEvent_ = function(node, name, thisObject, func) {
var wrapFunc = function(e) {