Fix @return JSDocs.

This commit is contained in:
Neil Fraser
2019-03-28 16:19:20 -07:00
committed by Neil Fraser
parent 68e134b073
commit e9de083361
35 changed files with 67 additions and 66 deletions

View File

@@ -622,7 +622,7 @@ Blockly.Constants.Text.QUOTE_IMAGE_MIXIN = {
* closing double quote. The selected quote will be adapted for RTL blocks.
* @param {boolean} open If the image should be open quote (“ in LTR).
* Otherwise, a closing quote is used (” in LTR).
* @returns {!Blockly.FieldImage} The new field.
* @return {!Blockly.FieldImage} The new field.
* @this Blockly.Block
*/
newQuote_: function(open) {

View File

@@ -814,7 +814,7 @@ Blockly.Block.prototype.setConnectionsHidden = function(hidden) {
* Used to match connections between a block and its insertion marker.
* @param {!Blockly.Block} otherBlock The other block to match against.
* @param {!Blockly.Connection} conn The other connection to match.
* @return {Blockly.Connection} the matching connection on this block, or null.
* @return {Blockly.Connection} The matching connection on this block, or null.
* @package
*/
Blockly.Block.prototype.getMatchingConnection = function(otherBlock, conn) {

View File

@@ -272,7 +272,7 @@ Blockly.BlockDragger.prototype.fireMoveEvent_ = function() {
/**
* Shut the trash can and, if necessary, delete the dragging block.
* Should be called at the end of a block drag.
* @return {boolean} whether the block was deleted.
* @return {boolean} Whether the block was deleted.
* @private
*/
Blockly.BlockDragger.prototype.maybeDeleteBlock_ = function() {

View File

@@ -986,7 +986,7 @@ Blockly.BlockSvg.prototype.setBorderColour_ = function(rgb, colourTertiary) {
* Sets the colour of shadow blocks.
* @param {!string} rgb Primary colour of the block.
* @param {?string} colourSecondary Colour for shadow block.
* @return {!string} hexColour The background colour of the block.
* @return {!string} The background colour of the block.
*/
Blockly.BlockSvg.prototype.setShadowColour_ = function(rgb, colourSecondary) {
var hexColour;

View File

@@ -745,7 +745,7 @@ Blockly.updateBlockStyles_ = function(blocks) {
/**
* Gets the theme.
* @return {?Blockly.Theme} theme Theme for Blockly.
* @return {?Blockly.Theme} Theme for Blockly.
*/
Blockly.getTheme = function() {
return this.theme_;

View File

@@ -462,7 +462,7 @@ Blockly.Bubble.prototype.layoutBubble_ = function() {
* @param {!number} relativeMin.y The y-position of the relativeMin.
* @param {!Object} metrics The metrics of the workspace the bubble will
* appear in.
* @returns {number} The percentage of the bubble that is visible.
* @return {number} The percentage of the bubble that is visible.
* @private
*/
Blockly.Bubble.prototype.getOverlap_ = function(relativeMin, metrics) {
@@ -508,7 +508,7 @@ Blockly.Bubble.prototype.getOverlap_ = function(relativeMin, metrics) {
* bubble is shown.
* @param {!Object} metrics The metrics of the workspace the bubble will
* appear in.
* @returns {number} The optimal horizontal position of the top-left corner
* @return {number} The optimal horizontal position of the top-left corner
* of the bubble.
* @private
*/
@@ -566,7 +566,7 @@ Blockly.Bubble.prototype.getOptimalRelativeLeft_ = function(metrics) {
* bubble is shown.
* @param {!Object} metrics The metrics of the workspace the bubble will
* appear in.
* @returns {number} The optimal vertical position of the top-left corner
* @return {number} The optimal vertical position of the top-left corner
* of the bubble.
* @private
*/

View File

@@ -151,7 +151,7 @@ Blockly.BubbleDragger.prototype.dragBubble = function(e, currentDragDeltaXY) {
/**
* Shut the trash can and, if necessary, delete the dragging bubble.
* Should be called at the end of a bubble drag.
* @return {boolean} whether the bubble was deleted.
* @return {boolean} Whether the bubble was deleted.
* @private
*/
Blockly.BubbleDragger.prototype.maybeDeleteBubble_ = function() {

View File

@@ -674,7 +674,7 @@ Blockly.Connection.prototype.setShadowDom = function(shadow) {
/**
* Return a connection's shadow block.
* @return {Element} shadow DOM representation of a block or null.
* @return {Element} Shadow DOM representation of a block or null.
*/
Blockly.Connection.prototype.getShadowDom = function() {
return this.shadowDom_;

View File

@@ -119,7 +119,7 @@ Blockly.DraggedConnectionManager.prototype.dispose = function() {
/**
* Return whether the block would be deleted if dropped immediately, based on
* information from the most recent move event.
* @return {boolean} true if the block would be deleted if dropped immediately.
* @return {boolean} True if the block would be deleted if dropped immediately.
* @package
*/
Blockly.DraggedConnectionManager.prototype.wouldDeleteBlock = function() {
@@ -129,7 +129,7 @@ Blockly.DraggedConnectionManager.prototype.wouldDeleteBlock = function() {
/**
* Return whether the block would be connected if dropped immediately, based on
* information from the most recent move event.
* @return {boolean} true if the block would be connected if dropped
* @return {boolean} True if the block would be connected if dropped
* immediately.
* @package
*/
@@ -220,7 +220,7 @@ Blockly.DraggedConnectionManager.prototype.addHighlighting_ = function() {
/**
* Populate the list of available connections on this block stack. This should
* only be called once, at the beginning of a drag.
* @return {!Array.<!Blockly.RenderedConnection>} a list of available
* @return {!Array.<!Blockly.RenderedConnection>} A list of available
* connections.
* @private
*/

View File

@@ -297,7 +297,7 @@ Blockly.DropDownDiv.show = function(owner, primaryX, primaryY, secondaryX, secon
/**
* Get sizing info about the bounding element.
* @return {!Object} an object containing size information about the bounding
* @return {!Object} An object containing size information about the bounding
* element (bounding box and width/height).
* @private
*/
@@ -322,7 +322,7 @@ Blockly.DropDownDiv.getBoundsInfo_ = function() {
* @param {number} primaryY Desired origin point y, in absolute px
* @param {number} secondaryX Secondary/alternative origin point x, in absolute px
* @param {number} secondaryY Secondary/alternative origin point y, in absolute px
* @returns {Object} Various final metrics, including rendered positions for drop-down and arrow.
* @return {Object} Various final metrics, including rendered positions for drop-down and arrow.
*/
Blockly.DropDownDiv.getPositionMetrics = function(primaryX, primaryY, secondaryX, secondaryY) {
var boundsInfo = Blockly.DropDownDiv.getBoundsInfo_();

View File

@@ -398,7 +398,7 @@ Blockly.Extensions.checkDropdownOptionsInTable_ = function(block, dropdownName,
* @param {string} msgTemplate The template form to of the message text, with
* %1 placeholder.
* @param {string} fieldName The field with the replacement text.
* @returns {Function} The extension function.
* @return {Function} The extension function.
*/
Blockly.Extensions.buildTooltipWithFieldText = function(msgTemplate,
fieldName) {

View File

@@ -83,7 +83,7 @@ Blockly.Field.register = function(type, fieldClass) {
* Blockly.Field.register.
* @param {!Object} options A JSON object with a type and options specific
* to the field type.
* @returns {?Blockly.Field} The new field instance or null if a field wasn't
* @return {?Blockly.Field} The new field instance or null if a field wasn't
* found with the given type name
* @package
*/
@@ -264,7 +264,7 @@ Blockly.Field.prototype.updateEditable = function() {
* editable (e.g. text labels). Those fields are not serialized to XML. Other
* fields may be editable, and therefore serialized, but may exist on
* non-editable blocks.
* @return {boolean} whether this field is editable and on an editable block
* @return {boolean} Whether this field is editable and on an editable block
*/
Blockly.Field.prototype.isCurrentlyEditable = function() {
return this.EDITABLE && !!this.sourceBlock_ && this.sourceBlock_.isEditable();

View File

@@ -58,7 +58,7 @@ goog.inherits(Blockly.FieldAngle, Blockly.FieldTextInput);
/**
* Construct a FieldAngle from a JSON arg object.
* @param {!Object} options A JSON object with options (angle).
* @returns {!Blockly.FieldAngle} The new field instance.
* @return {!Blockly.FieldAngle} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -50,7 +50,7 @@ goog.inherits(Blockly.FieldCheckbox, Blockly.Field);
/**
* Construct a FieldCheckbox from a JSON arg object.
* @param {!Object} options A JSON object with options (checked).
* @returns {!Blockly.FieldCheckbox} The new field instance.
* @return {!Blockly.FieldCheckbox} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -53,7 +53,7 @@ goog.inherits(Blockly.FieldColour, Blockly.Field);
/**
* Construct a FieldColour from a JSON arg object.
* @param {!Object} options A JSON object with options (colour).
* @returns {!Blockly.FieldColour} The new field instance.
* @return {!Blockly.FieldColour} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -61,7 +61,7 @@ goog.inherits(Blockly.FieldDate, Blockly.Field);
/**
* Construct a FieldDate from a JSON arg object.
* @param {!Object} options A JSON object with options (date).
* @returns {!Blockly.FieldDate} The new field instance.
* @return {!Blockly.FieldDate} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -68,7 +68,7 @@ goog.inherits(Blockly.FieldDropdown, Blockly.Field);
/**
* Construct a FieldDropdown from a JSON arg object.
* @param {!Object} options A JSON object with options (options).
* @returns {!Blockly.FieldDropdown} The new field instance.
* @return {!Blockly.FieldDropdown} The new field instance.
* @package
* @nocollapse
*/
@@ -249,7 +249,7 @@ Blockly.FieldDropdown.prototype.createWidget_ = function(menu) {
* the size of the checkmark that is displayed next to the currently selected
* item. This means that the item text will be positioned directly under the
* field text, rather than offset slightly.
* @returns {!Object} The bounding rectangle of the anchor, in window
* @return {!Object} The bounding rectangle of the anchor, in window
* coordinates.
* @private
*/

View File

@@ -69,7 +69,7 @@ goog.inherits(Blockly.FieldImage, Blockly.Field);
* dereferencing any string table references.
* @param {!Object} options A JSON object with options (src, width, height,
* alt, and flipRtl).
* @returns {!Blockly.FieldImage} The new field instance.
* @return {!Blockly.FieldImage} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -52,7 +52,7 @@ goog.inherits(Blockly.FieldLabel, Blockly.Field);
* Construct a FieldLabel from a JSON arg object,
* dereferencing any string table references.
* @param {!Object} options A JSON object with options (text, and class).
* @returns {!Blockly.FieldLabel} The new field instance.
* @return {!Blockly.FieldLabel} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -56,7 +56,7 @@ goog.inherits(Blockly.FieldNumber, Blockly.FieldTextInput);
* Construct a FieldNumber from a JSON arg object.
* @param {!Object} options A JSON object with options (value, min, max, and
* precision).
* @returns {!Blockly.FieldNumber} The new field instance.
* @return {!Blockly.FieldNumber} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -56,7 +56,7 @@ goog.inherits(Blockly.FieldTextInput, Blockly.Field);
* dereferencing any string table references.
* @param {!Object} options A JSON object with options (text, class, and
* spellcheck).
* @returns {!Blockly.FieldTextInput} The new field instance.
* @return {!Blockly.FieldTextInput} The new field instance.
* @package
* @nocollapse
*/

View File

@@ -67,7 +67,7 @@ goog.inherits(Blockly.FieldVariable, Blockly.FieldDropdown);
* dereferencing any string table references.
* @param {!Object} options A JSON object with options (variable,
* variableTypes, and defaultType).
* @returns {!Blockly.FieldVariable} The new field instance.
* @return {!Blockly.FieldVariable} The new field instance.
* @package
* @nocollapse
*/
@@ -160,7 +160,7 @@ Blockly.FieldVariable.prototype.getText = function() {
* Get the variable model for the selected variable.
* Not guaranteed to be in the variable map on the workspace (e.g. if accessed
* after the variable has been deleted).
* @return {?Blockly.VariableModel} the selected variable, or null if none was
* @return {?Blockly.VariableModel} The selected variable, or null if none was
* selected.
* @package
*/

View File

@@ -317,7 +317,7 @@ Blockly.HorizontalFlyout.prototype.layout_ = function(contents, gaps) {
* determine if a new block should be created or if the flyout should scroll.
* @param {!goog.math.Coordinate} currentDragDeltaXY How far the pointer has
* moved from the position at mouse down, in pixel units.
* @return {boolean} true if the drag is toward the workspace.
* @return {boolean} True if the drag is toward the workspace.
* @package
*/
Blockly.HorizontalFlyout.prototype.isDragTowardWorkspace = function(

View File

@@ -294,7 +294,7 @@ Blockly.VerticalFlyout.prototype.layout_ = function(contents, gaps) {
* determine if a new block should be created or if the flyout should scroll.
* @param {!goog.math.Coordinate} currentDragDeltaXY How far the pointer has
* moved from the position at mouse down, in pixel units.
* @return {boolean} true if the drag is toward the workspace.
* @return {boolean} True if the drag is toward the workspace.
* @package
*/
Blockly.VerticalFlyout.prototype.isDragTowardWorkspace = function(

View File

@@ -354,7 +354,7 @@ Blockly.Gesture.prototype.updateIsDraggingFromFlyout_ = function() {
* drag radius is exceeded. It should be called no more than once per gesture.
* If a bubble should be dragged this function creates the necessary
* BubbleDragger and starts the drag.
* @return {boolean} true if a bubble is being dragged.
* @return {boolean} True if a bubble is being dragged.
* @private
*/
Blockly.Gesture.prototype.updateIsDraggingBubble_ = function() {
@@ -373,7 +373,7 @@ Blockly.Gesture.prototype.updateIsDraggingBubble_ = function() {
* drag radius is exceeded. It should be called no more than once per gesture.
* If a block should be dragged, either from the flyout or in the workspace,
* this function creates the necessary BlockDragger and starts the drag.
* @return {boolean} true if a block is being dragged.
* @return {boolean} True if a block is being dragged.
* @private
*/
Blockly.Gesture.prototype.updateIsDraggingBlock_ = function() {
@@ -869,7 +869,7 @@ Blockly.Gesture.prototype.setStartFlyout_ = function(flyout) {
/**
* Whether this gesture is a click on a bubble. This should only be called when
* ending a gesture (mouse up, touch end).
* @return {boolean} whether this gesture was a click on a bubble.
* @return {boolean} Whether this gesture was a click on a bubble.
* @private
*/
Blockly.Gesture.prototype.isBubbleClick_ = function() {
@@ -881,7 +881,7 @@ Blockly.Gesture.prototype.isBubbleClick_ = function() {
/**
* Whether this gesture is a click on a block. This should only be called when
* ending a gesture (mouse up, touch end).
* @return {boolean} whether this gesture was a click on a block.
* @return {boolean} Whether this gesture was a click on a block.
* @private
*/
Blockly.Gesture.prototype.isBlockClick_ = function() {
@@ -894,7 +894,7 @@ Blockly.Gesture.prototype.isBlockClick_ = function() {
/**
* Whether this gesture is a click on a field. This should only be called when
* ending a gesture (mouse up, touch end).
* @return {boolean} whether this gesture was a click on a field.
* @return {boolean} Whether this gesture was a click on a field.
* @private
*/
Blockly.Gesture.prototype.isFieldClick_ = function() {
@@ -907,7 +907,7 @@ Blockly.Gesture.prototype.isFieldClick_ = function() {
/**
* Whether this gesture is a click on a workspace. This should only be called
* when ending a gesture (mouse up, touch end).
* @return {boolean} whether this gesture was a click on a workspace.
* @return {boolean} Whether this gesture was a click on a workspace.
* @private
*/
Blockly.Gesture.prototype.isWorkspaceClick_ = function() {
@@ -922,7 +922,7 @@ Blockly.Gesture.prototype.isWorkspaceClick_ = function() {
* Whether this gesture is a drag of either a workspace or block.
* This function is called externally to block actions that cannot be taken
* mid-drag (e.g. using the keyboard to delete the selected blocks).
* @return {boolean} true if this gesture is a drag of a workspace or block.
* @return {boolean} True if this gesture is a drag of a workspace or block.
* @package
*/
Blockly.Gesture.prototype.isDragging = function() {
@@ -934,7 +934,7 @@ Blockly.Gesture.prototype.isDragging = function() {
* Whether this gesture has already been started. In theory every mouse down
* has a corresponding mouse up, but in reality it is possible to lose a
* mouse up, leaving an in-process gesture hanging.
* @return {boolean} whether this gesture was a click on a workspace.
* @return {boolean} Whether this gesture was a click on a workspace.
* @package
*/
Blockly.Gesture.prototype.hasStarted = function() {

View File

@@ -178,7 +178,7 @@ Blockly.InsertionMarkerManager.prototype.dispose = function() {
/**
* Return whether the block would be deleted if dropped immediately, based on
* information from the most recent move event.
* @return {boolean} true if the block would be deleted if dropped immediately.
* @return {boolean} True if the block would be deleted if dropped immediately.
* @package
*/
Blockly.InsertionMarkerManager.prototype.wouldDeleteBlock = function() {
@@ -188,7 +188,8 @@ Blockly.InsertionMarkerManager.prototype.wouldDeleteBlock = function() {
/**
* Return whether the block would be connected if dropped immediately, based on
* information from the most recent move event.
* @return {boolean} true if the block would be connected if dropped immediately.
* @return {boolean} True if the block would be connected if dropped
* immediately.
* @package
*/
Blockly.InsertionMarkerManager.prototype.wouldConnectBlock = function() {
@@ -294,7 +295,7 @@ Blockly.InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlo
* only be called once, at the beginning of a drag.
* If the stack has more than one block, this function will populate
* lastOnStack_ and create the corresponding insertion marker.
* @return {!Array.<!Blockly.RenderedConnection>} a list of available
* @return {!Array.<!Blockly.RenderedConnection>} A list of available
* connections.
* @private
*/
@@ -320,7 +321,7 @@ Blockly.InsertionMarkerManager.prototype.initAvailableConnections_ = function()
* connection, and a radius. Returned by getCandidate_.
* @param {!goog.math.Coordinate} dxy Position relative to drag start,
* in workspace units.
* @return {boolean} whether the preview should be updated.
* @return {boolean} Whether the preview should be updated.
* @private
*/
Blockly.InsertionMarkerManager.prototype.shouldUpdatePreviews_ = function(
@@ -365,7 +366,7 @@ Blockly.InsertionMarkerManager.prototype.shouldUpdatePreviews_ = function(
* closest connection.
* @param {!goog.math.Coordinate} dxy Position relative to drag start,
* in workspace units.
* @return {!Object} candidate An object containing a local connection, a closest
* @return {!Object} An object containing a local connection, a closest
* connection, and a radius.
*/
Blockly.InsertionMarkerManager.prototype.getCandidate_ = function(dxy) {

View File

@@ -43,7 +43,7 @@ goog.getMsgOrig = goog.getMsg;
* Used infrequently, only known case is TODAY button in date picker.
* @param {string} str Translatable string, places holders in the form {$foo}.
* @param {Object.<string, string>=} opt_values Maps place holder name to value.
* @return {string} message with placeholders filled.
* @return {string} Message with placeholders filled.
* @suppress {duplicate}
*/
goog.getMsg = function(str, opt_values) {

View File

@@ -51,7 +51,7 @@ Blockly.Theme.prototype.setAllBlockStyles = function(blockStyles) {
/**
* Gets a list of all the block style names.
* @return {Array.<String>} styleName List of blockstyle names.
* @return {Array.<String>} List of blockstyle names.
*/
Blockly.Theme.prototype.getAllBlockStyles = function() {
return this.blockStyles_;

View File

@@ -210,7 +210,7 @@ Blockly.Touch.setClientFromTouch = function(e) {
/**
* Check whether a given event is a mouse or touch event.
* @param {!Event} e An event.
* @return {boolean} true if it is a mouse or touch event; false otherwise.
* @return {boolean} True if it is a mouse or touch event; false otherwise.
*/
Blockly.Touch.isMouseOrTouchEvent = function(e) {
return Blockly.utils.startsWith(e.type, 'touch') ||
@@ -221,7 +221,7 @@ Blockly.Touch.isMouseOrTouchEvent = function(e) {
/**
* Check whether a given event is a touch event or a pointer event.
* @param {!Event} e An event.
* @return {boolean} true if it is a touch event; false otherwise.
* @return {boolean} True if it is a touch event; false otherwise.
*/
Blockly.Touch.isTouchEvent = function(e) {
return Blockly.utils.startsWith(e.type, 'touch') ||

View File

@@ -206,7 +206,7 @@ Blockly.TouchGesture.prototype.handleUp = function(e) {
/**
* Whether this gesture is part of a multi-touch gesture.
* @return {boolean} whether this gesture is part of a multi-touch gesture.
* @return {boolean} Whether this gesture is part of a multi-touch gesture.
* @package
*/
Blockly.TouchGesture.prototype.isMultiTouch = function() {
@@ -301,7 +301,7 @@ Blockly.TouchGesture.prototype.handleTouchEnd = function(e) {
/**
* Helper function returning the current touch point coordinate.
* @param {!Event} e A touch or pointer event.
* @return {goog.math.Coordinate} the current touch point coordinate
* @return {goog.math.Coordinate} The current touch point coordinate
* @package
*/
Blockly.TouchGesture.prototype.getTouchPoint = function(e) {

View File

@@ -460,7 +460,7 @@ Blockly.Trashcan.prototype.mouseOut_ = function() {
/**
* Handle a BLOCK_DELETE event. Adds deleted blocks oldXml to the content array.
* @returns {!Function} Function to call when a block is deleted.
* @return {!Function} Function to call when a block is deleted.
* @private
*/
Blockly.Trashcan.prototype.onDelete_ = function() {
@@ -495,7 +495,7 @@ Blockly.Trashcan.prototype.onDelete_ = function() {
* content array.
* @param {!Element} xml An XML tree defining the block and any
* connected child blocks.
* @returns {!string} Text representing the XML tree, cleaned of all unnecessary
* @return {!string} Text representing the XML tree, cleaned of all unnecessary
* attributes.
* @private
*/

View File

@@ -817,7 +817,7 @@ Blockly.utils.wrapToText_ = function(words, wordBreaks) {
/**
* Check if 3D transforms are supported by adding an element
* and attempting to set the property.
* @return {boolean} true if 3D transforms are supported.
* @return {boolean} True if 3D transforms are supported.
*/
Blockly.utils.is3dSupported = function() {
if (Blockly.utils.is3dSupported.cached_ !== undefined) {
@@ -921,7 +921,7 @@ Blockly.utils.setCssTransform = function(node, transform) {
/**
* Get the position of the current viewport in window coordinates. This takes
* scroll into account.
* @return {!Object} an object containing window width, height, and scroll
* @return {!Object} An object containing window width, height, and scroll
* position in window coordinates.
* @package
*/
@@ -1008,7 +1008,7 @@ Blockly.utils.containsNode = function(parent, descendant) {
* @param {boolean=} opt_stripFollowing Optionally ignore all following
* statements (blocks that are not inside a value or statement input
* of the block).
* @returns {!Object} Map of types to type counts for descendants of the bock.
* @return {!Object} Map of types to type counts for descendants of the bock.
*/
Blockly.utils.getBlockTypeCounts = function(block, opt_stripFollowing) {
var typeCountsMap = Object.create(null);
@@ -1035,7 +1035,7 @@ Blockly.utils.getBlockTypeCounts = function(block, opt_stripFollowing) {
* @param {Number} lowerBound The desired lower bound.
* @param {Number} number The number to clamp.
* @param {Number} upperBound The desired upper bound.
* @return {Number} the clamped number
* @return {Number} The clamped number.
* @package
*/
Blockly.utils.clampNumber = function(lowerBound, number, upperBound) {

View File

@@ -159,7 +159,7 @@ Blockly.Workspace.SCAN_ANGLE = 3;
* compare.
* @param {!Blockly.Block | !Blockly.WorkspaceComment} b The second object to
* compare.
* @returns {number} The comparison value. This tells Array.sort() how to change
* @return {number} The comparison value. This tells Array.sort() how to change
* object a's index.
* @private
*/
@@ -442,7 +442,7 @@ Blockly.Workspace.prototype.variableIndexOf = function(_name) {
* @param {!string} name The name to check for.
* @param {string=} opt_type The type of the variable. If not provided it
* defaults to the empty string, which is a specific type.
* @return {?Blockly.VariableModel} the variable with the given name.
* @return {?Blockly.VariableModel} The variable with the given name.
*/
// TODO (#1199): Possibly delete this function.
Blockly.Workspace.prototype.getVariable = function(name, opt_type) {
@@ -545,7 +545,7 @@ Blockly.Workspace.prototype.remainingCapacityOfType = function(type) {
* than the remaining capacity for that type, it returns false.
* @param {!Object} typeCountsMap A map of types to counts (usually representing
* blocks to be created).
* @returns {boolean} True if there is capacity for the given map,
* @return {boolean} True if there is capacity for the given map,
* false otherwise.
*/
Blockly.Workspace.prototype.isCapacityAvailable = function(typeCountsMap) {
@@ -568,7 +568,7 @@ Blockly.Workspace.prototype.isCapacityAvailable = function(typeCountsMap) {
/**
* Checks if the workspace has any limits on the maximum number of blocks,
* or the maximum number of blocks of specific types.
* @returns {boolean} True if it has block limits, false otherwise.
* @return {boolean} True if it has block limits, false otherwise.
*/
Blockly.Workspace.prototype.hasBlockLimits = function() {
return this.options.maxBlocks != Infinity || !!this.options.maxInstances;

View File

@@ -137,7 +137,7 @@ Blockly.WorkspaceComment.prototype.dispose = function() {
/**
* Get comment height.
* @return {number} comment height.
* @return {number} Comment height.
* @package
*/
Blockly.WorkspaceComment.prototype.getHeight = function() {
@@ -146,7 +146,7 @@ Blockly.WorkspaceComment.prototype.getHeight = function() {
/**
* Set comment height.
* @param {number} height comment height.
* @param {number} height Comment height.
* @package
*/
Blockly.WorkspaceComment.prototype.setHeight = function(height) {
@@ -155,7 +155,7 @@ Blockly.WorkspaceComment.prototype.setHeight = function(height) {
/**
* Get comment width.
* @return {number} comment width.
* @return {number} Comment width.
* @package
*/
Blockly.WorkspaceComment.prototype.getWidth = function() {

View File

@@ -1266,7 +1266,7 @@ Blockly.WorkspaceSvg.prototype.isDraggable = function() {
* Should the workspace have bounded content? Used to tell if the
* workspace's content should be sized so that it can move (bounded) or not
* (exact sizing).
* @returns {boolean} True if the workspace should be bounded, false otherwise.
* @return {boolean} True if the workspace should be bounded, false otherwise.
* @package
*/
Blockly.WorkspaceSvg.prototype.isContentBounded = function() {
@@ -1285,7 +1285,7 @@ Blockly.WorkspaceSvg.prototype.isContentBounded = function() {
* through zooming with the scroll wheel (since the zoom is centered on the
* mouse position). This does not include zooming with the zoom controls
* since the X Y coordinates are decided programmatically.
* @returns {boolean} True if the workspace is movable, false otherwise.
* @return {boolean} True if the workspace is movable, false otherwise.
* @package
*/
Blockly.WorkspaceSvg.prototype.isMovable = function() {