From 1197afcee7a6dfcfbdde77f10317ffba90e418c2 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Mon, 12 Jul 2021 03:17:14 +0100 Subject: [PATCH] Fix JSDoc type annotations causing closure-make-deps warnings Some type annotations were missing curly brackets, which makes closure-make-deps emit uninteresting warnings. Now any output from the command will be informative and related to whatever one is presently working on. --- blocks/procedures.js | 4 ++-- core/contextmenu_items.js | 3 ++- core/renderers/geras/info.js | 12 ++++++------ core/renderers/thrasos/info.js | 12 ++++++------ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/blocks/procedures.js b/blocks/procedures.js index d6127cca0..644d7a751 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -519,7 +519,7 @@ Blockly.Blocks['procedures_mutatorarg'] = { * @param {string} varName User-supplied name. * @return {?string} Valid name, or null if a name was not specified. * @private - * @this Blockly.FieldTextInput + * @this {Blockly.FieldTextInput} */ validator_: function(varName) { var sourceBlock = this.getSourceBlock(); @@ -571,7 +571,7 @@ Blockly.Blocks['procedures_mutatorarg'] = { * variable name. * @param {string} newText The new variable name. * @private - * @this Blockly.FieldTextInput + * @this {Blockly.FieldTextInput} */ deleteIntermediateVars_: function(newText) { var outerWs = Blockly.Mutator.findParentWs(this.getSourceBlock().workspace); diff --git a/core/contextmenu_items.js b/core/contextmenu_items.js index 581de6cdf..a8e3a41e5 100644 --- a/core/contextmenu_items.js +++ b/core/contextmenu_items.js @@ -191,7 +191,8 @@ Blockly.ContextMenuItems.addDeletableBlocks_ = function(block, deleteList) { if (block.isDeletable()) { Array.prototype.push.apply(deleteList, block.getDescendants(false)); } else { - var children = /** @type !Array */ (block.getChildren(false)); + var children = + /** @type {!Array} */ (block.getChildren(false)); for (var i = 0; i < children.length; i++) { Blockly.ContextMenuItems.addDeletableBlocks_(children[i], deleteList); } diff --git a/core/renderers/geras/info.js b/core/renderers/geras/info.js index 4bca698f6..ffc515a17 100644 --- a/core/renderers/geras/info.js +++ b/core/renderers/geras/info.js @@ -158,7 +158,7 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!prev) { // Between an editable field and the beginning of the row. if (next && Blockly.blockRendering.Types.isField(next) && - (/** @type Blockly.blockRendering.Field */ (next)).isEditable) { + (/** @type {Blockly.blockRendering.Field} */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Inline input at the beginning of the row. @@ -177,7 +177,7 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { Blockly.blockRendering.Types.isStatementInput(next))) { // Between an editable field and the end of the row. if (Blockly.blockRendering.Types.isField(prev) && - (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { + (/** @type {Blockly.blockRendering.Field} */ (prev)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Padding at the end of an icon-only row to make the block shape clearer. @@ -219,7 +219,7 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { next && Blockly.blockRendering.Types.isInput(next)) { // Between an editable field and an input. if (Blockly.blockRendering.Types.isField(prev) && - (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { + (/** @type {Blockly.blockRendering.Field} */ (prev)).isEditable) { if (Blockly.blockRendering.Types.isInlineInput(next)) { return this.constants_.SMALL_PADDING; } else if (Blockly.blockRendering.Types.isExternalInput(next)) { @@ -247,7 +247,7 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (Blockly.blockRendering.Types.isInlineInput(prev) && next && Blockly.blockRendering.Types.isField(next)) { // Editable field after inline input. - if ((/** @type Blockly.blockRendering.Field */ (next)).isEditable) { + if ((/** @type {Blockly.blockRendering.Field} */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } else { // Noneditable field after inline input. @@ -288,8 +288,8 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { // Spacing between two fields of the same editability. if (Blockly.blockRendering.Types.isField(prev) && next && Blockly.blockRendering.Types.isField(next) && - ((/** @type Blockly.blockRendering.Field */ (prev)).isEditable == - (/** @type Blockly.blockRendering.Field */ (next)).isEditable)) { + ((/** @type {Blockly.blockRendering.Field} */ (prev)).isEditable == + (/** @type {Blockly.blockRendering.Field} */ (next)).isEditable)) { return this.constants_.LARGE_PADDING; } diff --git a/core/renderers/thrasos/info.js b/core/renderers/thrasos/info.js index a5208c57d..962c6ea6d 100644 --- a/core/renderers/thrasos/info.js +++ b/core/renderers/thrasos/info.js @@ -97,7 +97,7 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!prev) { // Between an editable field and the beginning of the row. if (next && Blockly.blockRendering.Types.isField(next) && - (/** @type Blockly.blockRendering.Field */ (next)).isEditable) { + (/** @type {Blockly.blockRendering.Field} */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Inline input at the beginning of the row. @@ -115,7 +115,7 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!Blockly.blockRendering.Types.isInput(prev) && !next) { // Between an editable field and the end of the row. if (Blockly.blockRendering.Types.isField(prev) && - (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { + (/** @type {Blockly.blockRendering.Field} */ (prev)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Padding at the end of an icon-only row to make the block shape clearer. @@ -157,7 +157,7 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { next && Blockly.blockRendering.Types.isInput(next)) { // Between an editable field and an input. if (Blockly.blockRendering.Types.isField(prev) && - (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { + (/** @type {Blockly.blockRendering.Field} */ (prev)).isEditable) { if (Blockly.blockRendering.Types.isInlineInput(next)) { return this.constants_.SMALL_PADDING; } else if (Blockly.blockRendering.Types.isExternalInput(next)) { @@ -185,7 +185,7 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (Blockly.blockRendering.Types.isInlineInput(prev) && next && Blockly.blockRendering.Types.isField(next)) { // Editable field after inline input. - if ((/** @type Blockly.blockRendering.Field */ (next)).isEditable) { + if ((/** @type {Blockly.blockRendering.Field} */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } else { // Noneditable field after inline input. @@ -213,8 +213,8 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { // Spacing between two fields of the same editability. if (Blockly.blockRendering.Types.isField(prev) && next && Blockly.blockRendering.Types.isField(next) && - ((/** @type Blockly.blockRendering.Field */ (prev)).isEditable == - (/** @type Blockly.blockRendering.Field */ (next)).isEditable)) { + ((/** @type {Blockly.blockRendering.Field} */ (prev)).isEditable == + (/** @type {Blockly.blockRendering.Field} */ (next)).isEditable)) { return this.constants_.LARGE_PADDING; }