diff --git a/core/block.js b/core/block.js index 625465bfb..684e6642e 100644 --- a/core/block.js +++ b/core/block.js @@ -72,6 +72,13 @@ Blockly.Block.obtain = function(workspace, prototypeName) { } }; +/** + * Optional text data that round-trips beween blocks and XML. + * Has no effect. May be used by 3rd parties for meta information. + * @type {?string} + */ +Blockly.Block.prototype.data = null; + /** * Initialization for one block. * @param {!Blockly.Workspace} workspace The new block's workspace. diff --git a/core/block_svg.js b/core/block_svg.js index 9c0d42040..30d4fdfa8 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -315,7 +315,7 @@ Blockly.BlockSvg.prototype.snapToGrid = function() { /** * Returns a bounding box describing the dimensions of this block * and any blocks stacked below it. - * @return {!Object} Object with height and width properties. + * @return {!{height: number, width: number}} Object with height and width properties. */ Blockly.BlockSvg.prototype.getHeightWidth = function() { var height = this.height; diff --git a/core/connection.js b/core/connection.js index 96799bfe2..a459d2514 100644 --- a/core/connection.js +++ b/core/connection.js @@ -493,7 +493,7 @@ Blockly.Connection.prototype.tighten_ = function() { * in the database and the current location (as a result of dragging). * @param {number} dy Vertical offset between this connection's location * in the database and the current location (as a result of dragging). - * @return {!Object} Contains two properties: 'connection' which is either + * @return {!{connection: ?Blockly.Connection, radius: number}} Contains two properties: 'connection' which is either * another connection or null, and 'radius' which is the distance. */ Blockly.Connection.prototype.closest = function(maxLimit, dx, dy) { diff --git a/core/xml.js b/core/xml.js index 070c1610f..2fda8caa0 100644 --- a/core/xml.js +++ b/core/xml.js @@ -99,8 +99,6 @@ Blockly.Xml.blockToDom_ = function(block) { } if (block.data) { - // Optional text data that round-trips beween blocks and XML. - // Has no effect. May be used by 3rd parties for meta information. var dataElement = goog.dom.createDom('data', null, block.data); element.appendChild(dataElement); } @@ -428,8 +426,6 @@ Blockly.Xml.domToBlockHeadless_ = } break; case 'data': - // Optional text data that round-trips beween blocks and XML. - // Has no effect. May be used by 3rd parties for meta information. block.data = xmlChild.textContent; break; case 'title':