diff --git a/blocks/logic.js b/blocks/logic.js index c45089dec..c7b6acf0c 100644 --- a/blocks/logic.js +++ b/blocks/logic.js @@ -473,9 +473,9 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = { }, /** * Reconnects child blocks. - * @param {!Array.} valueConnections List of + * @param {!Array} valueConnections List of * value connections for 'if' input. - * @param {!Array.} statementConnections List of + * @param {!Array} statementConnections List of * statement connections for 'do' input. * @param {?Blockly.RenderedConnection} elseStatementConnection Statement * connection for else input. diff --git a/blocks/procedures.js b/blocks/procedures.js index 242fa4f0b..d6127cca0 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -264,7 +264,7 @@ Blockly.Blocks['procedures_defnoreturn'] = { }, /** * Return all variables referenced by this block. - * @return {!Array.} List of variable names. + * @return {!Array} List of variable names. * @this {Blockly.Block} */ getVars: function() { @@ -272,7 +272,7 @@ Blockly.Blocks['procedures_defnoreturn'] = { }, /** * Return all variables referenced by this block. - * @return {!Array.} List of variable models. + * @return {!Array} List of variable models. * @this {Blockly.Block} */ getVarModels: function() { @@ -634,8 +634,8 @@ Blockly.Blocks['procedures_callnoreturn'] = { }, /** * Notification that the procedure's parameters have changed. - * @param {!Array.} paramNames New param names, e.g. ['x', 'y', 'z']. - * @param {!Array.} paramIds IDs of params (consistent for each + * @param {!Array} paramNames New param names, e.g. ['x', 'y', 'z']. + * @param {!Array} paramIds IDs of params (consistent for each * parameter through the life of a mutator, regardless of param renaming), * e.g. ['piua', 'f8b_', 'oi.o']. * @private @@ -809,7 +809,7 @@ Blockly.Blocks['procedures_callnoreturn'] = { }, /** * Return all variables referenced by this block. - * @return {!Array.} List of variable names. + * @return {!Array} List of variable names. * @this {Blockly.Block} */ getVars: function() { @@ -817,7 +817,7 @@ Blockly.Blocks['procedures_callnoreturn'] = { }, /** * Return all variables referenced by this block. - * @return {!Array.} List of variable models. + * @return {!Array} List of variable models. * @this {Blockly.Block} */ getVarModels: function() { diff --git a/core/block.js b/core/block.js index d5d89dfec..5b59f357d 100644 --- a/core/block.js +++ b/core/block.js @@ -77,7 +77,7 @@ Blockly.Block = function(workspace, prototypeName, opt_id) { this.nextConnection = null; /** @type {Blockly.Connection} */ this.previousConnection = null; - /** @type {!Array.} */ + /** @type {!Array} */ this.inputList = []; /** @type {boolean|undefined} */ this.inputsInline = undefined; @@ -98,7 +98,7 @@ Blockly.Block = function(workspace, prototypeName, opt_id) { this.parentBlock_ = null; /** - * @type {!Array.} + * @type {!Array} * @protected */ this.childBlocks_ = []; @@ -349,7 +349,7 @@ Blockly.Block.prototype.suppressPrefixSuffix; * An optional property for declaring developer variables. Return a list of * variable names for use by generators. Developer variables are never shown to * the user, but are declared as global variables in the generated code. - * @type {?function():!Array.} + * @type {?function():!Array} */ Blockly.Block.prototype.getDeveloperVariables; @@ -549,7 +549,7 @@ Blockly.Block.prototype.unplugFromStack_ = function(opt_healStack) { /** * Returns all connections originating from this block. * @param {boolean} _all If true, return all connections even hidden ones. - * @return {!Array.} Array of connections. + * @return {!Array} Array of connections. * @package */ Blockly.Block.prototype.getConnections_ = function(_all) { @@ -711,7 +711,7 @@ Blockly.Block.prototype.getTopStackBlock = function() { * Excludes any connection on an output tab or any preceding statement. * Blocks are optionally sorted by position; top to bottom. * @param {boolean} ordered Sort the list if true. - * @return {!Array.} Array of blocks. + * @return {!Array} Array of blocks. */ Blockly.Block.prototype.getChildren = function(ordered) { if (!ordered) { @@ -776,7 +776,7 @@ Blockly.Block.prototype.setParent = function(newParent) { * Excludes any connection on an output tab or any preceding statements. * Blocks are optionally sorted by position; top to bottom. * @param {boolean} ordered Sort the list if true. - * @return {!Array.} Flattened array of blocks. + * @return {!Array} Flattened array of blocks. */ Blockly.Block.prototype.getDescendants = function(ordered) { var blocks = [this]; @@ -1033,7 +1033,7 @@ Blockly.Block.prototype.getField = function(name) { /** * Return all variables referenced by this block. - * @return {!Array.} List of variable names. + * @return {!Array} List of variable names. */ Blockly.Block.prototype.getVars = function() { var vars = []; @@ -1049,7 +1049,7 @@ Blockly.Block.prototype.getVars = function() { /** * Return all variables referenced by this block. - * @return {!Array.} List of variable models. + * @return {!Array} List of variable models. * @package */ Blockly.Block.prototype.getVarModels = function() { @@ -1134,7 +1134,7 @@ Blockly.Block.prototype.setFieldValue = function(newValue, name) { /** * Set whether this block can chain onto the bottom of another block. * @param {boolean} newBoolean True if there can be a previous statement. - * @param {(string|Array.|null)=} opt_check Statement type or + * @param {(string|Array|null)=} opt_check Statement type or * list of statement types. Null/undefined if any type could be connected. */ Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) { @@ -1166,7 +1166,7 @@ Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) { /** * Set whether another block can chain onto the bottom of this block. * @param {boolean} newBoolean True if there can be a next statement. - * @param {(string|Array.|null)=} opt_check Statement type or + * @param {(string|Array|null)=} opt_check Statement type or * list of statement types. Null/undefined if any type could be connected. */ Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) { @@ -1194,7 +1194,7 @@ Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) { /** * Set whether this block returns a value. * @param {boolean} newBoolean True if there is an output. - * @param {(string|Array.|null)=} opt_check Returned type or list + * @param {(string|Array|null)=} opt_check Returned type or list * of returned types. Null or undefined if any type could be returned * (e.g. variable get). */ diff --git a/core/block_dragger.js b/core/block_dragger.js index 289561a1b..3fb9dc7ed 100644 --- a/core/block_dragger.js +++ b/core/block_dragger.js @@ -86,7 +86,7 @@ Blockly.BlockDragger = function(block, workspace) { * A list of all of the icons (comment, warning, and mutator) that are * on this block and its descendants. Moving an icon moves the bubble that * extends from it if that bubble is open. - * @type {Array.} + * @type {Array} * @private */ this.dragIconData_ = Blockly.BlockDragger.initIconData_(block); @@ -109,7 +109,7 @@ Blockly.BlockDragger.prototype.dispose = function() { * on this block and its descendants. Moving an icon moves the bubble that * extends from it if that bubble is open. * @param {!Blockly.BlockSvg} block The root block that is being dragged. - * @return {!Array.} The list of all icons and their locations. + * @return {!Array} The list of all icons and their locations. * @private */ Blockly.BlockDragger.initIconData_ = function(block) { @@ -372,7 +372,7 @@ Blockly.BlockDragger.prototype.dragIcons_ = function(dxy) { /** * Get a list of the insertion markers that currently exist. Drags have 0, 1, * or 2 insertion markers. - * @return {!Array.} A possibly empty list of insertion + * @return {!Array} A possibly empty list of insertion * marker blocks. * @package */ diff --git a/core/block_svg.js b/core/block_svg.js index feb4fafdb..390461a55 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -157,7 +157,7 @@ Blockly.BlockSvg.prototype.width = 0; /** * Map from IDs for warnings text to PIDs of functions to apply them. * Used to be able to maintain multiple warnings. - * @type {Object.} + * @type {Object} * @private */ Blockly.BlockSvg.prototype.warningTextDb_ = null; @@ -200,7 +200,7 @@ Blockly.BlockSvg.prototype.compose; /** * An optional method for defining custom block context menu items. - * @type {?function(!Array.)} + * @type {?function(!Array)} */ Blockly.BlockSvg.prototype.customContextMenu; @@ -748,7 +748,7 @@ Blockly.BlockSvg.prototype.showHelp = function() { /** * Generate the context menu for this block. * @protected - * @return {Array.} Context menu options + * @return {Array} Context menu options */ Blockly.BlockSvg.prototype.generateContextMenu = function() { if (this.workspace.options.readOnly || !this.contextMenu) { @@ -1279,7 +1279,7 @@ Blockly.BlockSvg.prototype.bringToFront = function() { /** * Set whether this block can chain onto the bottom of another block. * @param {boolean} newBoolean True if there can be a previous statement. - * @param {(string|Array.|null)=} opt_check Statement type or + * @param {(string|Array|null)=} opt_check Statement type or * list of statement types. Null/undefined if any type could be connected. */ Blockly.BlockSvg.prototype.setPreviousStatement = function(newBoolean, @@ -1296,7 +1296,7 @@ Blockly.BlockSvg.prototype.setPreviousStatement = function(newBoolean, /** * Set whether another block can chain onto the bottom of this block. * @param {boolean} newBoolean True if there can be a next statement. - * @param {(string|Array.|null)=} opt_check Statement type or + * @param {(string|Array|null)=} opt_check Statement type or * list of statement types. Null/undefined if any type could be connected. */ Blockly.BlockSvg.prototype.setNextStatement = function(newBoolean, opt_check) { @@ -1312,7 +1312,7 @@ Blockly.BlockSvg.prototype.setNextStatement = function(newBoolean, opt_check) { /** * Set whether this block returns a value. * @param {boolean} newBoolean True if there is an output. - * @param {(string|Array.|null)=} opt_check Returned type or list + * @param {(string|Array|null)=} opt_check Returned type or list * of returned types. Null or undefined if any type could be returned * (e.g. variable get). */ @@ -1445,7 +1445,7 @@ Blockly.BlockSvg.prototype.setConnectionTracking = function(track) { * @param {boolean} all If true, return all connections even hidden ones. * Otherwise, for a non-rendered block return an empty list, and for a * collapsed block don't return inputs connections. - * @return {!Array.} Array of connections. + * @return {!Array} Array of connections. * @package */ Blockly.BlockSvg.prototype.getConnections_ = function(all) { diff --git a/core/blockly.js b/core/blockly.js index 4ed797022..5391f6376 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -83,7 +83,7 @@ Blockly.selected = null; /** * All of the connections on blocks that are currently being dragged. - * @type {!Array.} + * @type {!Array} * @package */ Blockly.draggingConnections = []; @@ -373,7 +373,7 @@ Blockly.jsonInitFactory_ = function(jsonDef) { /** * Define blocks from an array of JSON block definitions, as might be generated * by the Blockly Developer Tools. - * @param {!Array.} jsonArray An array of JSON block definitions. + * @param {!Array} jsonArray An array of JSON block definitions. */ Blockly.defineBlocksWithJsonArray = function(jsonArray) { for (var i = 0; i < jsonArray.length; i++) { @@ -468,7 +468,7 @@ Blockly.checkBlockColourConstants = function() { * Checks for a constant in the Blockly namespace, verifying it is undefined or * has the old/original value. Prints a warning if this is not true. * @param {string} msgName The Msg constant identifier. - * @param {Array.} blocklyNamePath The name parts of the tested + * @param {Array} blocklyNamePath The name parts of the tested * constant. * @param {number|undefined} expectedValue The expected value of the constant. * @private diff --git a/core/blocks.js b/core/blocks.js index c39f81c0c..5f0d96b21 100644 --- a/core/blocks.js +++ b/core/blocks.js @@ -18,6 +18,6 @@ goog.provide('Blockly.Blocks'); /** * A mapping of block type names to block prototype objects. - * @type {!Object.} + * @type {!Object} */ Blockly.Blocks = Object.create(null); diff --git a/core/browser_events.js b/core/browser_events.js index 471ce0a46..4a7b03601 100644 --- a/core/browser_events.js +++ b/core/browser_events.js @@ -20,7 +20,7 @@ goog.require('Blockly.utils.global'); * Blockly opaque event data used to unbind events when using * `Blockly.browserEvents.bind` and * `Blockly.browserEvents.conditionalBind`. - * @typedef {!Array.} + * @typedef {!Array} */ Blockly.browserEvents.Data; diff --git a/core/connection.js b/core/connection.js index fcf214502..1165244e2 100644 --- a/core/connection.js +++ b/core/connection.js @@ -569,7 +569,7 @@ Blockly.Connection.prototype.onCheckChanged_ = function() { /** * Change a connection's compatibility. - * @param {?(string|!Array.)} check Compatible value type or list of + * @param {?(string|!Array)} check Compatible value type or list of * value types. Null if all types are compatible. * @return {!Blockly.Connection} The connection being modified * (to allow chaining). @@ -631,7 +631,7 @@ Blockly.Connection.prototype.getShadowDom = function() { * {@link Blockly.RenderedConnection} overrides this behavior with a list * computed from the rendered positioning. * @param {number} _maxLimit The maximum radius to another connection. - * @return {!Array.} List of connections. + * @return {!Array} List of connections. * @package */ Blockly.Connection.prototype.neighbours = function(_maxLimit) { diff --git a/core/connection_db.js b/core/connection_db.js index b670ff2f2..4fc832bf9 100644 --- a/core/connection_db.js +++ b/core/connection_db.js @@ -35,7 +35,7 @@ goog.requireType('Blockly.utils.Coordinate'); Blockly.ConnectionDB = function(checker) { /** * Array of connections sorted by y position in workspace units. - * @type {!Array.} + * @type {!Array} * @private */ this.connections_ = []; @@ -150,7 +150,7 @@ Blockly.ConnectionDB.prototype.removeConnection = function(connection, yPos) { * @param {!Blockly.RenderedConnection} connection The connection whose * neighbours should be returned. * @param {number} maxRadius The maximum radius to another connection. - * @return {!Array.} List of connections. + * @return {!Array} List of connections. */ Blockly.ConnectionDB.prototype.getNeighbours = function(connection, maxRadius) { var db = this.connections_; @@ -286,7 +286,7 @@ Blockly.ConnectionDB.prototype.searchForClosest = function(conn, maxRadius, * Initialize a set of connection DBs for a workspace. * @param {!Blockly.IConnectionChecker} checker The workspace's * connection checker, used to decide if connections are valid during a drag. - * @return {!Array.} Array of databases. + * @return {!Array} Array of databases. */ Blockly.ConnectionDB.init = function(checker) { // Create four databases, one for each connection type. diff --git a/core/contextmenu.js b/core/contextmenu.js index d663d03c5..e070207b7 100644 --- a/core/contextmenu.js +++ b/core/contextmenu.js @@ -54,7 +54,7 @@ Blockly.ContextMenu.menu_ = null; /** * Construct the menu based on the list of options and show the menu. * @param {!Event} e Mouse event. - * @param {!Array.} options Array of menu options. + * @param {!Array} options Array of menu options. * @param {boolean} rtl True if RTL, false if LTR. */ Blockly.ContextMenu.show = function(e, options, rtl) { @@ -75,7 +75,7 @@ Blockly.ContextMenu.show = function(e, options, rtl) { /** * Create the context menu object and populate it with the given options. - * @param {!Array.} options Array of menu options. + * @param {!Array} options Array of menu options. * @param {boolean} rtl True if RTL, false if LTR. * @return {!Blockly.Menu} The menu that will be shown on right click. * @private diff --git a/core/contextmenu_items.js b/core/contextmenu_items.js index 7df3c921d..63dbc702a 100644 --- a/core/contextmenu_items.js +++ b/core/contextmenu_items.js @@ -183,7 +183,7 @@ Blockly.ContextMenuItems.registerExpand = function() { /** * Adds a block and its children to a list of deletable blocks. * @param {!Blockly.BlockSvg} block to delete. - * @param {!Array.} deleteList list of blocks that can be deleted. This will be + * @param {!Array} deleteList list of blocks that can be deleted. This will be * modifed in place with the given block and its descendants. * @private */ @@ -191,7 +191,7 @@ 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); } @@ -201,7 +201,7 @@ Blockly.ContextMenuItems.addDeletableBlocks_ = function(block, deleteList) { /** * Constructs a list of blocks that can be deleted in the given workspace. * @param {!Blockly.WorkspaceSvg} workspace to delete all blocks from. - * @return {!Array.} list of blocks to delete. + * @return {!Array} list of blocks to delete. * @private */ Blockly.ContextMenuItems.getDeletableBlocks_ = function(workspace) { @@ -214,7 +214,7 @@ Blockly.ContextMenuItems.getDeletableBlocks_ = function(workspace) { }; /** Deletes the given blocks. Used to delete all blocks in the workspace. - * @param {!Array.} deleteList list of blocks to delete. + * @param {!Array} deleteList list of blocks to delete. * @param {string} eventGroup event group ID with which all delete events should be associated. * @private */ diff --git a/core/contextmenu_registry.js b/core/contextmenu_registry.js index f7bbfdbc6..503e5e963 100644 --- a/core/contextmenu_registry.js +++ b/core/contextmenu_registry.js @@ -133,7 +133,7 @@ Blockly.ContextMenuRegistry.prototype.getItem = function(id) { * shown (e.g. on a block or on a workspace) * @param {!Blockly.ContextMenuRegistry.Scope} scope Current scope of context menu * (i.e., the exact workspace or block being clicked on) - * @return {!Array.} the list of ContextMenuOptions + * @return {!Array} the list of ContextMenuOptions */ Blockly.ContextMenuRegistry.prototype.getContextMenuOptions = function(scopeType, scope) { var menuOptions = []; diff --git a/core/css.js b/core/css.js index c359af567..c33c2aed7 100644 --- a/core/css.js +++ b/core/css.js @@ -28,7 +28,7 @@ Blockly.Css.injected_ = false; * Add some CSS to the blob that will be injected later. Allows optional * components such as fields and the toolbox to store separate CSS. * The provided array of CSS will be destroyed by this function. - * @param {!Array.} cssArray Array of CSS strings. + * @param {!Array} cssArray Array of CSS strings. */ Blockly.Css.register = function(cssArray) { if (Blockly.Css.injected_) { diff --git a/core/events/events.js b/core/events/events.js index adf050262..975ed6300 100644 --- a/core/events/events.js +++ b/core/events/events.js @@ -266,9 +266,9 @@ Blockly.Events.fireNow_ = function() { /** * Filter the queued events and merge duplicates. - * @param {!Array.} queueIn Array of events. + * @param {!Array} queueIn Array of events. * @param {boolean} forward True if forward (redo), false if backward (undo). - * @return {!Array.} Array of filtered events. + * @return {!Array} Array of filtered events. */ Blockly.Events.filter = function(queueIn, forward) { var queue = queueIn.slice(); // Shallow copy of queue. @@ -396,7 +396,7 @@ Blockly.Events.setGroup = function(state) { /** * Compute a list of the IDs of the specified block and all its descendants. * @param {!Blockly.Block} block The root block. - * @return {!Array.} List of block IDs. + * @return {!Array} List of block IDs. * @package */ Blockly.Events.getDescendantIds = function(block) { diff --git a/core/events/events_block_drag.js b/core/events/events_block_drag.js index 202a9240d..9d256822a 100644 --- a/core/events/events_block_drag.js +++ b/core/events/events_block_drag.js @@ -26,7 +26,7 @@ goog.requireType('Blockly.Block'); * dragged. Undefined for a blank event. * @param {boolean=} opt_isStart Whether this is the start of a block drag. * Undefined for a blank event. - * @param {!Array.=} opt_blocks The blocks affected by this + * @param {!Array=} opt_blocks The blocks affected by this * drag. Undefined for a blank event. * @extends {Blockly.Events.UiBase} * @constructor @@ -44,7 +44,7 @@ Blockly.Events.BlockDrag = function(opt_block, opt_isStart, opt_blocks) { /** * The blocks affected by this drag event. - * @type {!Array.|undefined} + * @type {!Array|undefined} */ this.blocks = opt_blocks; }; diff --git a/core/extensions.js b/core/extensions.js index 267d172e7..ac0d22262 100644 --- a/core/extensions.js +++ b/core/extensions.js @@ -78,7 +78,7 @@ Blockly.Extensions.registerMixin = function(name, mixinObj) { * @param {!Object} mixinObj The values to mix in. * @param {(function())=} opt_helperFn An optional function to apply after * mixing in the object. - * @param {!Array.=} opt_blockList A list of blocks to appear in the + * @param {!Array=} opt_blockList A list of blocks to appear in the * flyout of the mutator dialog. * @throws {Error} if the mutation is invalid or can't be applied to the block. */ @@ -157,7 +157,7 @@ Blockly.Extensions.apply = function(name, block, isMutator) { Blockly.Extensions.checkBlockHasMutatorProperties_(errorPrefix, block); } else { if (!Blockly.Extensions.mutatorPropertiesMatch_( - /** @type {!Array.} */ (mutatorProperties), block)) { + /** @type {!Array} */ (mutatorProperties), block)) { throw Error('Error when applying extension "' + name + '": ' + 'mutation properties changed when applying a non-mutator extension.'); } @@ -257,7 +257,7 @@ Blockly.Extensions.checkBlockHasMutatorProperties_ = function(errorPrefix, /** * Get a list of values of mutator properties on the given block. * @param {!Blockly.Block} block The block to inspect. - * @return {!Array.} A list with all of the defined properties, which + * @return {!Array} A list with all of the defined properties, which * should be functions, but may be anything other than undefined. * @private */ @@ -284,7 +284,7 @@ Blockly.Extensions.getMutatorProperties_ = function(block) { * Check that the current mutator properties match a list of old mutator * properties. This should be called after applying a non-mutator extension, * to verify that the extension didn't change properties it shouldn't. - * @param {!Array.} oldProperties The old values to compare to. + * @param {!Array} oldProperties The old values to compare to. * @param {!Blockly.Block} block The block to inspect for new values. * @return {boolean} True if the property lists match. * @private @@ -317,7 +317,7 @@ Blockly.Extensions.mutatorPropertiesMatch_ = function(oldProperties, block) { * reported as warnings in the console, and are never fatal. * @param {string} dropdownName The name of the field whose value is the key * to the lookup table. - * @param {!Object.} lookupTable The table of field values to + * @param {!Object} lookupTable The table of field values to * tooltip text. * @return {!Function} The extension function. */ @@ -377,7 +377,7 @@ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, * Emits console warnings when they are not. * @param {!Blockly.Block} block The block containing the dropdown * @param {string} dropdownName The name of the dropdown - * @param {!Object.} lookupTable The string lookup table + * @param {!Object} lookupTable The string lookup table * @private */ Blockly.Extensions.checkDropdownOptionsInTable_ = function(block, dropdownName, diff --git a/core/field_colour.js b/core/field_colour.js index 8e8c940fe..dfd3113cc 100644 --- a/core/field_colour.js +++ b/core/field_colour.js @@ -130,14 +130,14 @@ Blockly.FieldColour.prototype.isDirty_ = false; /** * Array of colours used by this field. If null, use the global list. - * @type {Array.} + * @type {Array} * @private */ Blockly.FieldColour.prototype.colours_ = null; /** * Array of colour tooltips used by this field. If null, use the global list. - * @type {Array.} + * @type {Array} * @private */ Blockly.FieldColour.prototype.titles_ = null; @@ -243,7 +243,7 @@ Blockly.FieldColour.prototype.getText = function() { * An array of colour strings for the palette. * Copied from goog.ui.ColorPicker.SIMPLE_GRID_COLORS * All colour pickers use this unless overridden with setColours. - * @type {!Array.} + * @type {!Array} */ Blockly.FieldColour.COLOURS = [ // grays @@ -279,7 +279,7 @@ Blockly.FieldColour.prototype.DEFAULT_VALUE = Blockly.FieldColour.COLOURS[0]; * An array of tooltip strings for the palette. If not the same length as * COLOURS, the colour's hex code will be used for any missing titles. * All colour pickers use this unless overridden with setColours. - * @type {!Array.} + * @type {!Array} */ Blockly.FieldColour.TITLES = []; @@ -291,9 +291,9 @@ Blockly.FieldColour.COLUMNS = 7; /** * Set a custom colour grid for this field. - * @param {Array.} colours Array of colours for this block, + * @param {Array} colours Array of colours for this block, * or null to use default (Blockly.FieldColour.COLOURS). - * @param {Array.=} opt_titles Optional array of colour tooltips, + * @param {Array=} opt_titles Optional array of colour tooltips, * or null to use default (Blockly.FieldColour.TITLES). * @return {!Blockly.FieldColour} Returns itself (for method chaining). */ diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 14ca3cfa4..b376be75b 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -31,7 +31,7 @@ goog.require('Blockly.utils.userAgent'); /** * Class for an editable dropdown field. - * @param {(!Array.|!Function)} menuGenerator A non-empty array of + * @param {(!Array|!Function)} menuGenerator A non-empty array of * options for a dropdown list, or a function which generates these options. * @param {Function=} opt_validator A function that is called to validate * changes to the field's value. Takes in a language-neutral dropdown @@ -52,15 +52,15 @@ Blockly.FieldDropdown = function(menuGenerator, opt_validator, opt_config) { /** * An array of options for a dropdown list, * or a function which generates these options. - * @type {(!Array.| - * !function(this:Blockly.FieldDropdown): !Array.)} + * @type {(!Array| + * !function(this:Blockly.FieldDropdown): !Array)} * @protected */ this.menuGenerator_ = menuGenerator; /** * A cache of the most recently generated options. - * @type {Array.>} + * @type {Array>} * @private */ this.generatedOptions_ = null; @@ -449,11 +449,11 @@ Blockly.FieldDropdown.prototype.trimOptions_ = function() { /** * Use the calculated prefix and suffix lengths to trim all of the options in * the given array. - * @param {!Array.} options Array of option tuples: + * @param {!Array} options Array of option tuples: * (human-readable text or image, language-neutral name). * @param {number} prefixLength The length of the common prefix. * @param {number} suffixLength The length of the common suffix - * @return {!Array.} A new array with all of the option text trimmed. + * @return {!Array} A new array with all of the option text trimmed. */ Blockly.FieldDropdown.applyTrim_ = function(options, prefixLength, suffixLength) { @@ -480,7 +480,7 @@ Blockly.FieldDropdown.prototype.isOptionListDynamic = function() { * Return a list of the options for this dropdown. * @param {boolean=} opt_useCache For dynamic options, whether or not to use the * cached options or to re-generate them. - * @return {!Array.} A non-empty array of option tuples: + * @return {!Array} A non-empty array of option tuples: * (human-readable text or image, language-neutral name). * @throws {TypeError} If generated options are incorrectly structured. */ @@ -492,7 +492,7 @@ Blockly.FieldDropdown.prototype.getOptions = function(opt_useCache) { } return this.generatedOptions_; } - return /** @type {!Array.>} */ (this.menuGenerator_); + return /** @type {!Array>} */ (this.menuGenerator_); }; /** diff --git a/core/field_variable.js b/core/field_variable.js index ad0a7f034..8043b2c2f 100644 --- a/core/field_variable.js +++ b/core/field_variable.js @@ -39,7 +39,7 @@ goog.requireType('Blockly.MenuItem'); * @param {Function=} opt_validator A function that is called to validate * changes to the field's value. Takes in a variable ID & returns a * validated variable ID, or null to abort the change. - * @param {Array.=} opt_variableTypes A list of the types of variables + * @param {Array=} opt_variableTypes A list of the types of variables * to include in the dropdown. * @param {string=} opt_defaultType The type of variable to create if this * field's value is not explicitly set. Defaults to ''. @@ -58,8 +58,8 @@ Blockly.FieldVariable = function(varName, opt_validator, opt_variableTypes, /** * An array of options for a dropdown list, * or a function which generates these options. - * @type {(!Array.| - * !function(this:Blockly.FieldDropdown): !Array.)} + * @type {(!Array| + * !function(this:Blockly.FieldDropdown): !Array)} * @protected */ this.menuGenerator_ = Blockly.FieldVariable.dropdownCreate; @@ -312,7 +312,7 @@ Blockly.FieldVariable.prototype.typeIsAllowed_ = function(type) { /** * Return a list of variable types to include in the dropdown. - * @return {!Array.} Array of variable types. + * @return {!Array} Array of variable types. * @throws {Error} if variableTypes is an empty array. * @private */ @@ -338,7 +338,7 @@ Blockly.FieldVariable.prototype.getVariableTypes_ = function() { /** * Parse the optional arguments representing the allowed variable types and the * default variable type. - * @param {Array.=} opt_variableTypes A list of the types of variables + * @param {Array=} opt_variableTypes A list of the types of variables * to include in the dropdown. If null or undefined, variables of all types * will be displayed in the dropdown. * @param {string=} opt_defaultType The type of the variable to create if this @@ -388,7 +388,7 @@ Blockly.FieldVariable.prototype.refreshVariableName = function() { /** * Return a sorted list of variable names for variable dropdown menus. * Include a special option at the end for creating a new variable name. - * @return {!Array.} Array of variable names/id tuples. + * @return {!Array} Array of variable names/id tuples. * @this {Blockly.FieldVariable} */ Blockly.FieldVariable.dropdownCreate = function() { diff --git a/core/flyout_base.js b/core/flyout_base.js index 0341d7202..140df7b0e 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -91,7 +91,7 @@ Blockly.Flyout = function(workspaceOptions) { /** * Opaque data that can be passed to Blockly.unbindEvent_. - * @type {!Array.} + * @type {!Array} * @private */ this.eventWrappers_ = []; @@ -99,28 +99,28 @@ Blockly.Flyout = function(workspaceOptions) { /** * List of background mats that lurk behind each block to catch clicks * landing in the blocks' lakes and bays. - * @type {!Array.} + * @type {!Array} * @private */ this.mats_ = []; /** * List of visible buttons. - * @type {!Array.} + * @type {!Array} * @protected */ this.buttons_ = []; /** * List of event listeners. - * @type {!Array.} + * @type {!Array} * @private */ this.listeners_ = []; /** * List of blocks that should always be disabled. - * @type {!Array.} + * @type {!Array} * @private */ this.permanentlyDisabled_ = []; @@ -498,7 +498,7 @@ Blockly.Flyout.prototype.show = function(flyoutDef) { // Parse the Array, Node or NodeList into a a list of flyout items. var parsedContent = Blockly.utils.toolbox.convertFlyoutDefToJsonArray(flyoutDef); var flyoutInfo = - /** @type {{contents:!Array., gaps:!Array.}} */ ( + /** @type {{contents:!Array, gaps:!Array}} */ ( this.createFlyoutInfo_(parsedContent)); this.layout_(flyoutInfo.contents, flyoutInfo.gaps); @@ -537,7 +537,7 @@ Blockly.Flyout.prototype.show = function(flyoutDef) { * the flyout. * @param {!Blockly.utils.toolbox.FlyoutItemInfoArray} parsedContent The array * of objects to show in the flyout. - * @return {{contents:Array., gaps:Array.}} The list of contents + * @return {{contents:Array, gaps:Array}} The list of contents * and gaps needed to lay out the flyout. * @private */ @@ -594,7 +594,7 @@ Blockly.Flyout.prototype.createFlyoutInfo_ = function(parsedContent) { /** * Gets the flyout definition for the dynamic category. * @param {string} categoryName The name of the dynamic category. - * @return {!Array.} The array of flyout items. + * @return {!Array} The array of flyout items. * @private */ Blockly.Flyout.prototype.getDynamicCategoryContents_ = function(categoryName) { @@ -684,7 +684,7 @@ Blockly.Flyout.prototype.getBlockXml_ = function(blockInfo) { * Add the necessary gap in the flyout for a separator. * @param {!Blockly.utils.toolbox.SeparatorInfo} sepInfo The object holding * information about a separator. - * @param {!Array.} gaps The list gaps between items in the flyout. + * @param {!Array} gaps The list gaps between items in the flyout. * @param {number} defaultGap The default gap between the button and next element. * @private */ @@ -1051,8 +1051,8 @@ Blockly.Flyout.prototype.setMetrics_; /** * Lay out the blocks in the flyout. - * @param {!Array.} contents The blocks and buttons to lay out. - * @param {!Array.} gaps The visible gaps between blocks. + * @param {!Array} contents The blocks and buttons to lay out. + * @param {!Array} gaps The visible gaps between blocks. * @protected */ Blockly.Flyout.prototype.layout_; diff --git a/core/flyout_horizontal.js b/core/flyout_horizontal.js index 951d84aac..701861802 100644 --- a/core/flyout_horizontal.js +++ b/core/flyout_horizontal.js @@ -231,8 +231,8 @@ Blockly.HorizontalFlyout.prototype.wheel_ = function(e) { /** * Lay out the blocks in the flyout. - * @param {!Array.} contents The blocks and buttons to lay out. - * @param {!Array.} gaps The visible gaps between blocks. + * @param {!Array} contents The blocks and buttons to lay out. + * @param {!Array} gaps The visible gaps between blocks. * @protected */ Blockly.HorizontalFlyout.prototype.layout_ = function(contents, gaps) { diff --git a/core/flyout_vertical.js b/core/flyout_vertical.js index 142e50aa9..d59907e9d 100644 --- a/core/flyout_vertical.js +++ b/core/flyout_vertical.js @@ -222,8 +222,8 @@ Blockly.VerticalFlyout.prototype.wheel_ = function(e) { /** * Lay out the blocks in the flyout. - * @param {!Array.} contents The blocks and buttons to lay out. - * @param {!Array.} gaps The visible gaps between blocks. + * @param {!Array} contents The blocks and buttons to lay out. + * @param {!Array} gaps The visible gaps between blocks. * @protected */ Blockly.VerticalFlyout.prototype.layout_ = function(contents, gaps) { diff --git a/core/generator.js b/core/generator.js index 7b6ed3920..d0583b2ee 100644 --- a/core/generator.js +++ b/core/generator.js @@ -72,7 +72,7 @@ Blockly.Generator.prototype.COMMENT_WRAP = 60; /** * List of outer-inner pairings that do NOT require parentheses. - * @type {!Array.>} + * @type {!Array>} */ Blockly.Generator.prototype.ORDER_OVERRIDES = []; @@ -442,7 +442,7 @@ Object.defineProperty(Blockly.Generator.prototype, 'variableDB_', { * * @param {string} desiredName The desired name of the function * (e.g. mathIsPrime). - * @param {!Array.} code A list of statements. Use ' ' for indents. + * @param {!Array} code A list of statements. Use ' ' for indents. * @return {string} The actual name of the new function. This may differ * from desiredName if the former has already been taken by the user. * @protected diff --git a/core/gesture.js b/core/gesture.js index 8b759989f..106ec2ea5 100644 --- a/core/gesture.js +++ b/core/gesture.js @@ -953,7 +953,7 @@ Blockly.Gesture.prototype.hasStarted = function() { /** * Get a list of the insertion markers that currently exist. Block drags have * 0, 1, or 2 insertion markers. - * @return {!Array.} A possibly empty list of insertion + * @return {!Array} A possibly empty list of insertion * marker blocks. * @package */ diff --git a/core/input.js b/core/input.js index d898ce351..10107cfa6 100644 --- a/core/input.js +++ b/core/input.js @@ -50,7 +50,7 @@ Blockly.Input = function(type, name, block, connection) { this.sourceBlock_ = block; /** @type {Blockly.Connection} */ this.connection = connection; - /** @type {!Array.} */ + /** @type {!Array} */ this.fieldRow = []; }; @@ -185,7 +185,7 @@ Blockly.Input.prototype.isVisible = function() { * Sets whether this input is visible or not. * Should only be used to collapse/uncollapse a block. * @param {boolean} visible True if visible. - * @return {!Array.} List of blocks to render. + * @return {!Array} List of blocks to render. * @package */ Blockly.Input.prototype.setVisible = function(visible) { @@ -230,7 +230,7 @@ Blockly.Input.prototype.markDirty = function() { /** * Change a connection's compatibility. - * @param {string|Array.|null} check Compatible value type or + * @param {string|Array|null} check Compatible value type or * list of value types. Null if all types are compatible. * @return {!Blockly.Input} The input being modified (to allow chaining). */ diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index 79fee0a04..1a758dbcb 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -131,7 +131,7 @@ Blockly.InsertionMarkerManager = function(block) { * other blocks. This includes all open connections on the top block, as well * as the last connection on the block stack. * Does not change during a drag. - * @type {!Array.} + * @type {!Array} * @private */ this.availableConnections_ = this.initAvailableConnections_(); @@ -322,7 +322,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.} A list of available + * @return {!Array} A list of available * connections. * @private */ @@ -713,7 +713,7 @@ Blockly.InsertionMarkerManager.prototype.hideReplacementFade_ = function() { /** * Get a list of the insertion markers that currently exist. Drags have 0, 1, * or 2 insertion markers. - * @return {!Array.} A possibly empty list of insertion + * @return {!Array} A possibly empty list of insertion * marker blocks. * @package */ diff --git a/core/menu.js b/core/menu.js index f4b52bd98..2f5b81109 100644 --- a/core/menu.js +++ b/core/menu.js @@ -32,7 +32,7 @@ Blockly.Menu = function() { * Array of menu items. * (Nulls are never in the array, but typing the array as nullable prevents * the compiler from objecting to .indexOf(null)) - * @type {!Array.} + * @type {!Array} * @private */ this.menuItems_ = []; diff --git a/core/mutator.js b/core/mutator.js index b3aedec22..f211420ce 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -40,7 +40,7 @@ goog.requireType('Blockly.Workspace'); /** * Class for a mutator dialog. - * @param {!Array.} quarkNames List of names of sub-blocks for flyout. + * @param {!Array} quarkNames List of names of sub-blocks for flyout. * @extends {Blockly.Icon} * @constructor */ diff --git a/core/names.js b/core/names.js index 0fe897aa0..402d99056 100644 --- a/core/names.js +++ b/core/names.js @@ -136,7 +136,7 @@ Blockly.Names.prototype.getName = function(name, realm) { * Return a list of all known user-created names in a specified realm. * @param {string} realm The realm of entity in Blockly * ('VARIABLE', 'PROCEDURE', 'DEVELOPER_VARIABLE', etc...). - * @return {!Array.} A list of Blockly entity names (no constraints). + * @return {!Array} A list of Blockly entity names (no constraints). */ Blockly.Names.prototype.getUserNames = function(realm) { var realmDb = this.db_[realm] || {}; diff --git a/core/options.js b/core/options.js index db88025b0..58c4e378a 100644 --- a/core/options.js +++ b/core/options.js @@ -123,7 +123,7 @@ Blockly.Options = function(options) { this.readOnly = readOnly; /** @type {number} */ this.maxBlocks = options['maxBlocks'] || Infinity; - /** @type {?Object.} */ + /** @type {?Object} */ this.maxInstances = options['maxInstances']; /** @type {string} */ this.pathToMedia = pathToMedia; @@ -175,7 +175,7 @@ Blockly.Options = function(options) { /** * Map of plugin type to name of registered plugin or plugin class. - * @type {!Object.} + * @type {!Object} */ this.plugins = plugins; }; diff --git a/core/procedures.js b/core/procedures.js index 28d55b0cf..93d282ec3 100644 --- a/core/procedures.js +++ b/core/procedures.js @@ -60,7 +60,7 @@ Blockly.Procedures.ProcedureBlock; /** * Find all user-created procedure definitions in a workspace. * @param {!Blockly.Workspace} root Root workspace. - * @return {!Array.>} Pair of arrays, the + * @return {!Array>} Pair of arrays, the * first contains procedures without return variables, the second with. * Each procedure is defined by a three-element list of name, parameter * list, and return value boolean. @@ -188,7 +188,7 @@ Blockly.Procedures.rename = function(name) { /** * Construct the blocks required by the flyout for the procedure category. * @param {!Blockly.Workspace} workspace The workspace containing procedures. - * @return {!Array.} Array of XML block elements. + * @return {!Array} Array of XML block elements. */ Blockly.Procedures.flyoutCategory = function(workspace) { var xmlList = []; @@ -337,7 +337,7 @@ Blockly.Procedures.mutatorChangeListener_ = function(e) { * Find all the callers of a named procedure. * @param {string} name Name of procedure. * @param {!Blockly.Workspace} workspace The workspace to find callers in. - * @return {!Array.} Array of caller blocks. + * @return {!Array} Array of caller blocks. */ Blockly.Procedures.getCallers = function(name, workspace) { var callers = []; diff --git a/core/rendered_connection.js b/core/rendered_connection.js index 246414625..5d70b5ecb 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -386,7 +386,7 @@ Blockly.RenderedConnection.prototype.stopTrackingAll = function() { /** * Start tracking this connection, as well as all down-stream connections on * any block attached to this connection. This happens when a block is expanded. - * @return {!Array.} List of blocks to render. + * @return {!Array} List of blocks to render. */ Blockly.RenderedConnection.prototype.startTrackingAll = function() { this.setTracking(true); @@ -509,7 +509,7 @@ Blockly.RenderedConnection.prototype.respawnShadow_ = function() { * Type checking does not apply, since this function is used for bumping. * @param {number} maxLimit The maximum radius to another connection, in * workspace units. - * @return {!Array.} List of connections. + * @return {!Array} List of connections. * @package */ Blockly.RenderedConnection.prototype.neighbours = function(maxLimit) { diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index 6ff75a777..282d355d5 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -587,7 +587,7 @@ Blockly.blockRendering.ConstantProvider.prototype.setTheme = function( /** * The block styles map. - * @type {Object.} + * @type {Object} * @package */ this.blockStyles = {}; @@ -1181,7 +1181,7 @@ Blockly.blockRendering.ConstantProvider.prototype.injectCSS_ = function( /** * Get any renderer specific CSS to inject when the renderer is initialized. * @param {string} selector CSS selector to use. - * @return {!Array.} Array of CSS strings. + * @return {!Array} Array of CSS strings. * @protected */ Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) { diff --git a/core/renderers/common/debugger.js b/core/renderers/common/debugger.js index 5a1803653..0e99fc613 100644 --- a/core/renderers/common/debugger.js +++ b/core/renderers/common/debugger.js @@ -38,7 +38,7 @@ goog.requireType('Blockly.RenderedConnection'); Blockly.blockRendering.Debug = function(constants) { /** * An array of SVG elements that have been created by this object. - * @type {Array.} + * @type {Array} * @private */ this.debugElements_ = []; @@ -62,7 +62,7 @@ Blockly.blockRendering.Debug = function(constants) { /** * Configuration object containing booleans to enable and disable debug * rendering of specific rendering components. - * @type {!Object.} + * @type {!Object} */ Blockly.blockRendering.Debug.config = { rowSpacers: true, diff --git a/core/renderers/common/info.js b/core/renderers/common/info.js index 598509adc..8600b588c 100644 --- a/core/renderers/common/info.js +++ b/core/renderers/common/info.js @@ -135,19 +135,19 @@ Blockly.blockRendering.RenderInfo = function(renderer, block) { /** * An array of Row objects containing sizing information. - * @type {!Array.} + * @type {!Array} */ this.rows = []; /** * An array of input rows on the block. - * @type {!Array.} + * @type {!Array} */ this.inputRows = []; /** * An array of measurable objects containing hidden icons. - * @type {!Array.} + * @type {!Array} */ this.hiddenIcons = []; diff --git a/core/renderers/measurables/rows.js b/core/renderers/measurables/rows.js index 0c458b605..b300e96ed 100644 --- a/core/renderers/measurables/rows.js +++ b/core/renderers/measurables/rows.js @@ -47,7 +47,7 @@ Blockly.blockRendering.Row = function(constants) { /** * An array of elements contained in this row. * @package - * @type {!Array.} + * @type {!Array} */ this.elements = []; diff --git a/core/renderers/zelos/path_object.js b/core/renderers/zelos/path_object.js index 391cd26fc..4362e8c2b 100644 --- a/core/renderers/zelos/path_object.js +++ b/core/renderers/zelos/path_object.js @@ -52,7 +52,7 @@ Blockly.zelos.PathObject = function(root, style, constants) { /** * The outline paths on the block. - * @type {!Object.} + * @type {!Object} * @private */ this.outlines_ = {}; @@ -62,7 +62,7 @@ Blockly.zelos.PathObject = function(root, style, constants) { * set is initialized with a reference to all the outlines in * `this.outlines_`. Every time we use an outline during the draw pass, the * reference is removed from this set. - * @type {Object.} + * @type {Object} * @private */ this.remainingOutlines_ = null; diff --git a/core/scrollbar.js b/core/scrollbar.js index 341d1fdfd..703f73b0a 100644 --- a/core/scrollbar.js +++ b/core/scrollbar.js @@ -58,7 +58,7 @@ Blockly.ScrollbarPair = function( this.hScroll = new Blockly.Scrollbar( workspace, true, isPair, opt_class, opt_margin); } - if (addVertical ) { + if (addVertical) { this.vScroll = new Blockly.Scrollbar( workspace, false, isPair, opt_class, opt_margin); } diff --git a/core/shortcut_registry.js b/core/shortcut_registry.js index 90a8af7f3..7ecc00d24 100644 --- a/core/shortcut_registry.js +++ b/core/shortcut_registry.js @@ -320,7 +320,7 @@ Blockly.ShortcutRegistry.prototype.checkModifiers_ = function( /** * Creates the serialized key code that will be used in the key map. * @param {number} keyCode Number code representing the key. - * @param {?Array.} modifiers List of modifier key codes to be used with + * @param {?Array} modifiers List of modifier key codes to be used with * the key. All valid modifiers can be found in the * Blockly.ShortcutRegistry.modifierKeys. * @return {string} The serialized key code for the given modifiers and key. diff --git a/core/theme.js b/core/theme.js index 3fcdb5c25..182710f16 100644 --- a/core/theme.js +++ b/core/theme.js @@ -19,9 +19,9 @@ goog.require('Blockly.utils.object'); /** * Class for a theme. * @param {string} name Theme name. - * @param {!Object.=} opt_blockStyles A map + * @param {!Object=} opt_blockStyles A map * from style names (strings) to objects with style attributes for blocks. - * @param {!Object.=} opt_categoryStyles A + * @param {!Object=} opt_categoryStyles A * map from style names (strings) to objects with style attributes for * categories. * @param {!Blockly.Theme.ComponentStyle=} opt_componentStyles A map of Blockly @@ -39,14 +39,14 @@ Blockly.Theme = function(name, opt_blockStyles, opt_categoryStyles, /** * The block styles map. - * @type {!Object.} + * @type {!Object} * @package */ this.blockStyles = opt_blockStyles || Object.create(null); /** * The category styles map. - * @type {!Object.} + * @type {!Object} * @package */ this.categoryStyles = opt_categoryStyles || Object.create(null); diff --git a/core/theme_manager.js b/core/theme_manager.js index 64cb1cae4..6c461a2e7 100644 --- a/core/theme_manager.js +++ b/core/theme_manager.js @@ -45,14 +45,14 @@ Blockly.ThemeManager = function(workspace, theme) { /** * A list of workspaces that are subscribed to this theme. - * @type {!Array.} + * @type {!Array} * @private */ this.subscribedWorkspaces_ = []; /** * A map of subscribed UI components, keyed by component name. - * @type {!Object.>} + * @type {!Object>} * @private */ this.componentDB_ = Object.create(null); diff --git a/core/touch.js b/core/touch.js index 62bbddf19..b6668c398 100644 --- a/core/touch.js +++ b/core/touch.js @@ -175,7 +175,7 @@ Blockly.Touch.getTouchIdentifierFromEvent = function(e) { Blockly.Touch.checkTouchIdentifier = function(e) { var identifier = Blockly.Touch.getTouchIdentifierFromEvent(e); - // if (Blockly.touchIdentifier_ )is insufficient because Android touch + // if (Blockly.touchIdentifier_) is insufficient because Android touch // identifiers may be zero. if (Blockly.Touch.touchIdentifier_ !== undefined && Blockly.Touch.touchIdentifier_ !== null) { @@ -236,7 +236,7 @@ Blockly.Touch.isTouchEvent = function(e) { * point. * @param {!Event} e A mouse event or a touch event with one or more changed * touches. - * @return {!Array.} An array of mouse or touch events. Each touch + * @return {!Array} An array of mouse or touch events. Each touch * event will have exactly one changed touch. */ Blockly.Touch.splitEventByTouches = function(e) { diff --git a/core/trashcan.js b/core/trashcan.js index b402fd6f9..ff2a2676a 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -53,7 +53,7 @@ Blockly.Trashcan = function(workspace) { /** * A list of XML (stored as strings) representing blocks in the trashcan. - * @type {!Array.} + * @type {!Array} * @private */ this.contents_ = []; diff --git a/core/utils.js b/core/utils.js index b6141b3c8..ddff23028 100644 --- a/core/utils.js +++ b/core/utils.js @@ -213,7 +213,7 @@ Blockly.utils.getScrollDeltaPixels = function(e) { * (e.g., '%%'). * @param {string} message Text which might contain string table references and * interpolation tokens. - * @return {!Array.} Array of strings and numbers. + * @return {!Array} Array of strings and numbers. */ Blockly.utils.tokenizeInterpolation = function(message) { return Blockly.utils.tokenizeInterpolation_(message, true); @@ -270,7 +270,7 @@ Blockly.utils.checkMessageReferences = function(message) { * interpolation tokens. * @param {boolean} parseInterpolationTokens Option to parse numeric * interpolation tokens (%1, %2, ...) when true. - * @return {!Array.} Array of strings and numbers. + * @return {!Array} Array of strings and numbers. * @private */ Blockly.utils.tokenizeInterpolation_ = function(message, diff --git a/core/utils/aria.js b/core/utils/aria.js index f455b9928..189c99898 100644 --- a/core/utils/aria.js +++ b/core/utils/aria.js @@ -155,7 +155,7 @@ Blockly.utils.aria.setRole = function(element, roleName) { * @param {!Blockly.utils.aria.State} stateName State attribute being set. * Automatically adds prefix 'aria-' to the state name if the attribute is * not an extra attribute. - * @param {string|boolean|number|!Array.} value Value + * @param {string|boolean|number|!Array} value Value * for the state attribute. */ Blockly.utils.aria.setState = function(element, stateName, value) { diff --git a/core/utils/colour.js b/core/utils/colour.js index ded55d5e9..b64b81eb5 100644 --- a/core/utils/colour.js +++ b/core/utils/colour.js @@ -79,7 +79,7 @@ Blockly.utils.colour.rgbToHex = function(r, g, b) { * Converts a colour to RGB. * @param {string} colour String representing colour in any * colour format ('#ff0000', 'red', '0xff000', etc). - * @return {!Array.} RGB representation of the colour. + * @return {!Array} RGB representation of the colour. */ Blockly.utils.colour.hexToRgb = function(colour) { var hex = Blockly.utils.colour.parse(colour); diff --git a/core/utils/string.js b/core/utils/string.js index 2d1b8e6e1..880401a4c 100644 --- a/core/utils/string.js +++ b/core/utils/string.js @@ -32,7 +32,7 @@ Blockly.utils.string.startsWith = function(str, prefix) { /** * Given an array of strings, return the length of the shortest one. - * @param {!Array.} array Array of strings. + * @param {!Array} array Array of strings. * @return {number} Length of shortest string. */ Blockly.utils.string.shortestStringLength = function(array) { @@ -47,7 +47,7 @@ Blockly.utils.string.shortestStringLength = function(array) { /** * Given an array of strings, return the length of the common prefix. * Words may not be split. Any space after a word is included in the length. - * @param {!Array.} array Array of strings. + * @param {!Array} array Array of strings. * @param {number=} opt_shortest Length of shortest string. * @return {number} Length of common prefix. */ @@ -82,7 +82,7 @@ Blockly.utils.string.commonWordPrefix = function(array, opt_shortest) { /** * Given an array of strings, return the length of the common suffix. * Words may not be split. Any space after a word is included in the length. - * @param {!Array.} array Array of strings. + * @param {!Array} array Array of strings. * @param {number=} opt_shortest Length of shortest string. * @return {number} Length of common suffix. */ @@ -180,8 +180,8 @@ Blockly.utils.string.wrapLine_ = function(text, limit) { /** * Compute a score for how good the wrapping is. - * @param {!Array.} words Array of each word. - * @param {!Array.} wordBreaks Array of line breaks. + * @param {!Array} words Array of each word. + * @param {!Array} wordBreaks Array of line breaks. * @param {number} limit Width to wrap each line. * @return {number} Larger the better. * @private @@ -232,10 +232,10 @@ Blockly.utils.string.wrapScore_ = function(words, wordBreaks, limit) { /** * Mutate the array of line break locations until an optimal solution is found. * No line breaks are added or deleted, they are simply moved around. - * @param {!Array.} words Array of each word. - * @param {!Array.} wordBreaks Array of line breaks. + * @param {!Array} words Array of each word. + * @param {!Array} wordBreaks Array of line breaks. * @param {number} limit Width to wrap each line. - * @return {!Array.} New array of optimal line breaks. + * @return {!Array} New array of optimal line breaks. * @private */ Blockly.utils.string.wrapMutate_ = function(words, wordBreaks, limit) { @@ -266,8 +266,8 @@ Blockly.utils.string.wrapMutate_ = function(words, wordBreaks, limit) { /** * Reassemble the array of words into text, with the specified line breaks. - * @param {!Array.} words Array of each word. - * @param {!Array.} wordBreaks Array of line breaks. + * @param {!Array} words Array of each word. + * @param {!Array} wordBreaks Array of line breaks. * @return {string} Plain text. * @private */ diff --git a/core/utils/svg_paths.js b/core/utils/svg_paths.js index d2066599a..e123dca28 100644 --- a/core/utils/svg_paths.js +++ b/core/utils/svg_paths.js @@ -38,7 +38,7 @@ Blockly.utils.svgPaths.point = function(x, y) { * These coordinates are unitless and hence in the user coordinate system. * @param {string} command The command to use. * Should be one of: c, C, s, S, q, Q. - * @param {!Array.} points An array containing all of the points to pass to the + * @param {!Array} points An array containing all of the points to pass to the * curve command, in order. The points are represented as strings of the * format ' x, y '. * @return {string} A string defining one or more Bezier curves. See the MDN @@ -96,7 +96,7 @@ Blockly.utils.svgPaths.lineTo = function(dx, dy) { * equivalent to a series of 'l' commands. * These coordinates are unitless and hence in the user coordinate system. * See developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands - * @param {!Array.} points An array containing all of the points to + * @param {!Array} points An array containing all of the points to * draw lines to, in order. The points are represented as strings of the * format ' dx,dy '. * @return {string} A string of the format ' l (dx,dy)+ ' diff --git a/core/variable_map.js b/core/variable_map.js index 9c559b92e..7cd1e08af 100644 --- a/core/variable_map.js +++ b/core/variable_map.js @@ -38,7 +38,7 @@ Blockly.VariableMap = function(workspace) { * A map from variable type to list of variable names. The lists contain all * of the named variables in the workspace, including variables * that are not currently in use. - * @type {!Object.>} + * @type {!Object>} * @private */ this.variableMap_ = Object.create(null); @@ -102,7 +102,7 @@ Blockly.VariableMap.prototype.renameVariableById = function(id, newName) { * The new name must not conflict with any existing variable names. * @param {!Blockly.VariableModel} variable Variable to rename. * @param {string} newName New variable name. - * @param {!Array.} blocks The list of all blocks in the + * @param {!Array} blocks The list of all blocks in the * workspace. * @private */ @@ -125,7 +125,7 @@ Blockly.VariableMap.prototype.renameVariableAndUses_ = function(variable, * @param {string} newName New variable name. * @param {!Blockly.VariableModel} conflictVar The variable that was already * using newName. - * @param {!Array.} blocks The list of all blocks in the + * @param {!Array} blocks The list of all blocks in the * workspace. * @private */ @@ -264,7 +264,7 @@ Blockly.VariableMap.prototype.deleteVariableById = function(id) { * Deletes a variable and all of its uses from this workspace without asking the * user for confirmation. * @param {!Blockly.VariableModel} variable Variable to delete. - * @param {!Array.} uses An array of uses of the variable. + * @param {!Array} uses An array of uses of the variable. * @package */ Blockly.VariableMap.prototype.deleteVariableInternal = function(variable, @@ -317,7 +317,7 @@ Blockly.VariableMap.prototype.getVariable = function(name, opt_type) { */ Blockly.VariableMap.prototype.getVariableById = function(id) { var keys = Object.keys(this.variableMap_); - for (var i = 0; i < keys.length; i++ ) { + for (var i = 0; i < keys.length; i++) { var key = keys[i]; for (var j = 0, variable; (variable = this.variableMap_[key][j]); j++) { if (variable.getId() == id) { @@ -332,7 +332,7 @@ Blockly.VariableMap.prototype.getVariableById = function(id) { * Get a list containing all of the variables of a specified type. If type is * null, return list of variables with empty string type. * @param {?string} type Type of the variables to find. - * @return {!Array.} The sought after variables of the + * @return {!Array} The sought after variables of the * passed in type. An empty array if none are found. */ Blockly.VariableMap.prototype.getVariablesOfType = function(type) { @@ -350,7 +350,7 @@ Blockly.VariableMap.prototype.getVariablesOfType = function(type) { * @param {?Blockly.Workspace} ws The workspace used to look for potential * variables. This can be different than the workspace stored on this object * if the passed in ws is a flyout workspace. - * @return {!Array.} List of variable types. + * @return {!Array} List of variable types. * @package */ Blockly.VariableMap.prototype.getVariableTypes = function(ws) { @@ -375,7 +375,7 @@ Blockly.VariableMap.prototype.getVariableTypes = function(ws) { /** * Return all variables of all types. - * @return {!Array.} List of variable models. + * @return {!Array} List of variable models. */ Blockly.VariableMap.prototype.getAllVariables = function() { var all_variables = []; @@ -387,7 +387,7 @@ Blockly.VariableMap.prototype.getAllVariables = function() { /** * Returns all of the variable names of all types. - * @return {!Array.} All of the variable names of all types. + * @return {!Array} All of the variable names of all types. */ Blockly.VariableMap.prototype.getAllVariableNames = function() { var allNames = []; @@ -403,7 +403,7 @@ Blockly.VariableMap.prototype.getAllVariableNames = function() { /** * Find all the uses of a named variable. * @param {string} id ID of the variable to find. - * @return {!Array.} Array of block usages. + * @return {!Array} Array of block usages. */ Blockly.VariableMap.prototype.getVariableUsesById = function(id) { var uses = []; diff --git a/core/variables.js b/core/variables.js index 5d4cb9a6e..ac515a6a3 100644 --- a/core/variables.js +++ b/core/variables.js @@ -41,7 +41,7 @@ Blockly.Variables.NAME_TYPE = Blockly.VARIABLE_CATEGORY_NAME; * To get a list of all variables on a workspace, including unused variables, * call Workspace.getAllVariables. * @param {!Blockly.Workspace} ws The workspace to search for variables. - * @return {!Array.} Array of variable models. + * @return {!Array} Array of variable models. */ Blockly.Variables.allUsedVarModels = function(ws) { var blocks = ws.getAllBlocks(false); @@ -81,7 +81,7 @@ Blockly.Variables.ALL_DEVELOPER_VARS_WARNINGS_BY_BLOCK_TYPE_ = {}; * your block and return a list of variable names. * For use by generators. * @param {!Blockly.Workspace} workspace The workspace to search. - * @return {!Array.} A list of non-duplicated variable names. + * @return {!Array} A list of non-duplicated variable names. */ Blockly.Variables.allDeveloperVariables = function(workspace) { var blocks = workspace.getAllBlocks(false); @@ -116,7 +116,7 @@ Blockly.Variables.allDeveloperVariables = function(workspace) { * Construct the elements (blocks and button) required by the flyout for the * variable category. * @param {!Blockly.Workspace} workspace The workspace containing variables. - * @return {!Array.} Array of XML elements. + * @return {!Array} Array of XML elements. */ Blockly.Variables.flyoutCategory = function(workspace) { var xmlList = []; @@ -138,7 +138,7 @@ Blockly.Variables.flyoutCategory = function(workspace) { /** * Construct the blocks required by the flyout for the variable category. * @param {!Blockly.Workspace} workspace The workspace containing variables. - * @return {!Array.} Array of XML block elements. + * @return {!Array} Array of XML block elements. */ Blockly.Variables.flyoutCategoryBlocks = function(workspace) { var variableModelList = workspace.getVariablesOfType(''); @@ -207,7 +207,7 @@ Blockly.Variables.generateUniqueName = function(workspace) { * will try to generate single letter names in the range a -> z (skip l). It * will start with the character passed to startChar. * @param {string} startChar The character to start the search at. - * @param {!Array.} usedNames A list of all of the used names. + * @param {!Array} usedNames A list of all of the used names. * @return {string} A unique name that is not present in the usedNames array. */ Blockly.Variables.generateUniqueNameFromOptions = function(startChar, usedNames) { @@ -551,9 +551,9 @@ Blockly.Variables.createVariable_ = function(workspace, id, opt_name, * workspace after adding a new block, using the given list of variables that * were in the workspace before the new block was added. * @param {!Blockly.Workspace} workspace The workspace to inspect. - * @param {!Array.} originalVariables The array of + * @param {!Array} originalVariables The array of * variables that existed in the workspace before adding the new block. - * @return {!Array.} The new array of variables that + * @return {!Array} The new array of variables that * were freshly added to the workspace after creating the new block, * or [] if no new variables were added to the workspace. * @package diff --git a/core/variables_dynamic.js b/core/variables_dynamic.js index f761e5273..630064eeb 100644 --- a/core/variables_dynamic.js +++ b/core/variables_dynamic.js @@ -38,7 +38,7 @@ Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour = function(button) { * Construct the elements (blocks and button) required by the flyout for the * variable category. * @param {!Blockly.Workspace} workspace The workspace containing variables. - * @return {!Array.} Array of XML elements. + * @return {!Array} Array of XML elements. */ Blockly.VariablesDynamic.flyoutCategory = function(workspace) { var xmlList = []; @@ -71,7 +71,7 @@ Blockly.VariablesDynamic.flyoutCategory = function(workspace) { /** * Construct the blocks required by the flyout for the variable category. * @param {!Blockly.Workspace} workspace The workspace containing variables. - * @return {!Array.} Array of XML block elements. + * @return {!Array} Array of XML block elements. */ Blockly.VariablesDynamic.flyoutCategoryBlocks = function(workspace) { var variableModelList = workspace.getAllVariables(); diff --git a/core/workspace.js b/core/workspace.js index 7dd4c0c1c..9e48f29d8 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -60,12 +60,12 @@ Blockly.Workspace = function(opt_options) { this.connectionChecker = new connectionCheckerClass(this); /** - * @type {!Array.} + * @type {!Array} * @private */ this.topBlocks_ = []; /** - * @type {!Array.} + * @type {!Array} * @private */ this.topComments_ = []; @@ -75,17 +75,17 @@ Blockly.Workspace = function(opt_options) { */ this.commentDB_ = Object.create(null); /** - * @type {!Array.} + * @type {!Array} * @private */ this.listeners_ = []; /** - * @type {!Array.} + * @type {!Array} * @protected */ this.undoStack_ = []; /** - * @type {!Array.} + * @type {!Array} * @protected */ this.redoStack_ = []; @@ -144,7 +144,7 @@ Blockly.Workspace.prototype.MAX_UNDO = 1024; /** * Set of databases for rapid lookup of connection locations. - * @type {Array.} + * @type {Array} */ Blockly.Workspace.prototype.connectionDBList = null; @@ -208,7 +208,7 @@ Blockly.Workspace.prototype.removeTopBlock = function(block) { * Finds the top-level blocks and returns them. Blocks are optionally sorted * by position; top to bottom (with slight LTR or RTL bias). * @param {boolean} ordered Sort the list if true. - * @return {!Array.} The top-level block objects. + * @return {!Array} The top-level block objects. */ Blockly.Workspace.prototype.getTopBlocks = function(ordered) { // Copy the topBlocks_ list. @@ -252,7 +252,7 @@ Blockly.Workspace.prototype.removeTypedBlock = function(block) { * optionally sorted by position; top to bottom (with slight LTR or RTL bias). * @param {string} type The type of block to search for. * @param {boolean} ordered Sort the list if true. - * @return {!Array.} The blocks of the given type. + * @return {!Array} The blocks of the given type. */ Blockly.Workspace.prototype.getBlocksByType = function(type, ordered) { if (!this.typedBlocksDB_[type]) { @@ -306,7 +306,7 @@ Blockly.Workspace.prototype.removeTopComment = function(comment) { * Finds the top-level comments and returns them. Comments are optionally * sorted by position; top to bottom (with slight LTR or RTL bias). * @param {boolean} ordered Sort the list if true. - * @return {!Array.} The top-level comment objects. + * @return {!Array} The top-level comment objects. * @package */ Blockly.Workspace.prototype.getTopComments = function(ordered) { @@ -327,7 +327,7 @@ Blockly.Workspace.prototype.getTopComments = function(ordered) { * Find all blocks in workspace. Blocks are optionally sorted * by position; top to bottom (with slight LTR or RTL bias). * @param {boolean} ordered Sort the list if true. - * @return {!Array.} Array of blocks. + * @return {!Array} Array of blocks. */ Blockly.Workspace.prototype.getAllBlocks = function(ordered) { if (ordered) { @@ -411,7 +411,7 @@ Blockly.Workspace.prototype.createVariable = function(name, opt_type, opt_id) { /** * Find all the uses of the given variable, which is identified by ID. * @param {string} id ID of the variable to find. - * @return {!Array.} Array of block usages. + * @return {!Array} Array of block usages. */ Blockly.Workspace.prototype.getVariableUsesById = function(id) { return this.variableMap_.getVariableUsesById(id); @@ -453,7 +453,7 @@ Blockly.Workspace.prototype.getVariableById = function(id) { * Find the variable with the specified type. If type is null, return list of * variables with empty string type. * @param {?string} type Type of the variables to find. - * @return {!Array.} The sought after variables of the + * @return {!Array} The sought after variables of the * passed in type. An empty array if none are found. */ Blockly.Workspace.prototype.getVariablesOfType = function(type) { @@ -462,7 +462,7 @@ Blockly.Workspace.prototype.getVariablesOfType = function(type) { /** * Return all variable types. - * @return {!Array.} List of variable types. + * @return {!Array} List of variable types. * @package */ Blockly.Workspace.prototype.getVariableTypes = function() { @@ -471,7 +471,7 @@ Blockly.Workspace.prototype.getVariableTypes = function() { /** * Return all variables of all types. - * @return {!Array.} List of variable models. + * @return {!Array} List of variable models. */ Blockly.Workspace.prototype.getAllVariables = function() { return this.variableMap_.getAllVariables(); @@ -479,7 +479,7 @@ Blockly.Workspace.prototype.getAllVariables = function() { /** * Returns all variable names of all types. - * @return {!Array.} List of all variable names of all types. + * @return {!Array} List of all variable names of all types. */ Blockly.Workspace.prototype.getAllVariableNames = function() { return this.variableMap_.getAllVariableNames(); @@ -577,7 +577,7 @@ Blockly.Workspace.prototype.hasBlockLimits = function() { /** * Gets the undo stack for workplace. - * @return {!Array.} undo stack + * @return {!Array} undo stack * @package */ Blockly.Workspace.prototype.getUndoStack = function() { @@ -586,7 +586,7 @@ Blockly.Workspace.prototype.getUndoStack = function() { /** * Gets the redo stack for workplace. - * @return {!Array.} redo stack + * @return {!Array} redo stack * @package */ Blockly.Workspace.prototype.getRedoStack = function() { @@ -782,7 +782,7 @@ Blockly.Workspace.getById = function(id) { /** * Find all workspaces. - * @return {!Array.} Array of workspaces. + * @return {!Array} Array of workspaces. */ Blockly.Workspace.getAll = function() { var workspaces = []; diff --git a/core/workspace_audio.js b/core/workspace_audio.js index 81fcfda73..954b8f892 100644 --- a/core/workspace_audio.js +++ b/core/workspace_audio.js @@ -63,7 +63,7 @@ Blockly.WorkspaceAudio.prototype.dispose = function() { /** * Load an audio file. Cache it, ready for instantaneous playing. - * @param {!Array.} filenames List of file types in decreasing order of + * @param {!Array} filenames List of file types in decreasing order of * preference (i.e. increasing size). E.g. ['media/go.mp3', 'media/go.wav'] * Filenames include path from Blockly's root. File extensions matter. * @param {string} name Name of sound. diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 32df698d6..e4bb74948 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -135,7 +135,7 @@ Blockly.WorkspaceSvg = function( /** * List of currently highlighted blocks. Block highlighting is often used to * visually mark blocks currently being executed. - * @type {!Array.} + * @type {!Array} * @private */ this.highlightedBlocks_ = []; @@ -166,7 +166,7 @@ Blockly.WorkspaceSvg = function( /** * Map from function names to callbacks, for deciding what to do when a custom * toolbox category is opened. - * @type {!Object.>} + * @type {!Object>} * @private */ this.toolboxCategoryCallbacks_ = {}; @@ -174,7 +174,7 @@ Blockly.WorkspaceSvg = function( /** * Map from function names to callbacks, for deciding what to do when a button * is clicked. - * @type {!Object.} + * @type {!Object} * @private */ this.flyoutButtonCallbacks_ = {}; @@ -227,7 +227,7 @@ Blockly.WorkspaceSvg = function( /** * The list of top-level bounded elements on the workspace. - * @type {!Array.} + * @type {!Array} * @private */ this.topBoundedElements_ = []; @@ -487,7 +487,7 @@ Blockly.WorkspaceSvg.prototype.lastRecordedPageScroll_ = null; /** * Developers may define this function to add custom menu options to the * workspace's context menu or edit the workspace-created set of menu options. - * @param {!Array.} options List of menu options to add to. + * @param {!Array} options List of menu options to add to. * @param {!Event} e The right-click event that triggered the context menu. */ Blockly.WorkspaceSvg.prototype.configureContextMenu; @@ -666,7 +666,7 @@ Blockly.WorkspaceSvg.prototype.refreshTheme = function() { /** * Updates all the blocks with new style. - * @param {!Array.} blocks List of blocks to update the style + * @param {!Array} blocks List of blocks to update the style * on. * @private */ @@ -2326,7 +2326,7 @@ Blockly.WorkspaceSvg.prototype.getBlockById = function(id) { * Finds the top-level blocks and returns them. Blocks are optionally sorted * by position; top to bottom (with slight LTR or RTL bias). * @param {boolean} ordered Sort the list if true. - * @return {!Array.} The top-level block objects. + * @return {!Array} The top-level block objects. * @override */ Blockly.WorkspaceSvg.prototype.getTopBlocks = function(ordered) { @@ -2389,7 +2389,7 @@ Blockly.WorkspaceSvg.prototype.removeTopBoundedElement = function(element) { /** * Finds the top-level bounded elements and returns them. - * @return {!Array.} The top-level bounded elements. + * @return {!Array} The top-level bounded elements. */ Blockly.WorkspaceSvg.prototype.getTopBoundedElements = function() { return [].concat(this.topBoundedElements_); @@ -2464,7 +2464,7 @@ Blockly.WorkspaceSvg.prototype.removeButtonCallback = function(key) { * custom toolbox categories in this workspace. See the variable and procedure * categories as an example. * @param {string} key The name to use to look up this function. - * @param {function(!Blockly.Workspace):!Array.} func The function to + * @param {function(!Blockly.Workspace):!Array} func The function to * call when the given toolbox category is opened. */ Blockly.WorkspaceSvg.prototype.registerToolboxCategoryCallback = function(key, @@ -2479,7 +2479,7 @@ Blockly.WorkspaceSvg.prototype.registerToolboxCategoryCallback = function(key, * Get the callback function associated with a given key, for populating * custom toolbox categories in this workspace. * @param {string} key The name to use to look up the function. - * @return {?function(!Blockly.Workspace):!Array.} The function + * @return {?function(!Blockly.Workspace):!Array} The function * corresponding to the given key for this workspace, or null if no function * is registered. */ diff --git a/core/xml.js b/core/xml.js index e8c6940cf..9a6b045e1 100644 --- a/core/xml.js +++ b/core/xml.js @@ -59,7 +59,7 @@ Blockly.Xml.workspaceToDom = function(workspace, opt_noId) { /** * Encode a list of variables as XML. - * @param {!Array.} variableList List of all variable + * @param {!Array} variableList List of all variable * models. * @return {!Element} Tree of XML elements. */ @@ -375,7 +375,7 @@ Blockly.Xml.textToDom = function(text) { * create blocks on the workspace. * @param {!Element} xml XML DOM. * @param {!Blockly.Workspace} workspace The workspace. - * @return {Array.} An array containing new block ids. + * @return {Array} An array containing new block ids. */ Blockly.Xml.clearWorkspaceAndLoadFromXml = function(xml, workspace) { workspace.setResizesEnabled(false); @@ -389,7 +389,7 @@ Blockly.Xml.clearWorkspaceAndLoadFromXml = function(xml, workspace) { * Decode an XML DOM and create blocks on the workspace. * @param {!Element} xml XML DOM. * @param {!Blockly.Workspace} workspace The workspace. - * @return {!Array.} An array containing new block IDs. + * @return {!Array} An array containing new block IDs. * @suppress {strictModuleDepCheck} Suppress module check while workspace * comments are not bundled in. */ @@ -489,7 +489,7 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) { * blocks immediately below prior blocks, aligned by their starting edge. * @param {!Element} xml The XML DOM. * @param {!Blockly.Workspace} workspace The workspace to add to. - * @return {Array.} An array containing new block IDs. + * @return {Array} An array containing new block IDs. */ Blockly.Xml.appendDomToWorkspace = function(xml, workspace) { var bbox; // Bounding box of the current blocks. diff --git a/demos/blockfactory/app_controller.js b/demos/blockfactory/app_controller.js index 60fb0bb1e..58b70b88d 100644 --- a/demos/blockfactory/app_controller.js +++ b/demos/blockfactory/app_controller.js @@ -432,7 +432,7 @@ AppController.prototype.assignExporterChangeListeners = function() { /** * If given checkbox is checked, enable the given elements. Otherwise, disable. * @param {boolean} enabled True if enabled, false otherwise. - * @param {!Array.} idArray Array of element IDs to enable when + * @param {!Array} idArray Array of element IDs to enable when * checkbox is checked. */ AppController.prototype.ifCheckedEnable = function(enabled, idArray) { diff --git a/demos/blockfactory/block_definition_extractor.js b/demos/blockfactory/block_definition_extractor.js index bbd171d51..0a9687f4b 100644 --- a/demos/blockfactory/block_definition_extractor.js +++ b/demos/blockfactory/block_definition_extractor.js @@ -49,7 +49,7 @@ BlockDefinitionExtractor.buildBlockFactoryWorkspace = function(block) { * inner text. * * @param {string} name New element tag name. - * @param {!Object.=} opt_attrs Optional list of attributes. + * @param {!Object=} opt_attrs Optional list of attributes. * @param {string=} opt_text Optional inner text. * @return {!Element} The newly created element. * @private @@ -112,7 +112,7 @@ BlockDefinitionExtractor.buildTypeConstraintBlockForConnection_ = } else if (connection.check_.length === 1) { typeBlock = BlockDefinitionExtractor.buildBlockForType_( connection.check_[0]); - } else if (connection.check_.length > 1 ) { + } else if (connection.check_.length > 1) { typeBlock = BlockDefinitionExtractor.typeGroup_(connection.check_); } } else { @@ -323,7 +323,7 @@ BlockDefinitionExtractor.input_ = function(input, align) { /** * Constructs a sequence elements representing the field definition. - * @param {Array.} fieldRow A list of fields in a Blockly.Input. + * @param {Array} fieldRow A list of fields in a Blockly.Input. * @return {Element} The fist element of the sequence * (and the root of the constructed DOM). * @private @@ -600,7 +600,7 @@ BlockDefinitionExtractor.buildFieldImage_ = /** * Creates a element a group of allowed connection constraint types. * - * @param {Array.} types List of type names in this group. + * @param {Array} types List of type names in this group. * @return {Element} The element representing the group, with child * types attached. * @private diff --git a/demos/blockfactory/block_exporter_controller.js b/demos/blockfactory/block_exporter_controller.js index 525a2fefc..b195bf374 100644 --- a/demos/blockfactory/block_exporter_controller.js +++ b/demos/blockfactory/block_exporter_controller.js @@ -253,7 +253,7 @@ BlockExporterController.prototype.selectUsedBlocks = function() { /** * Set the array that holds the block types used in workspace factory. - * @param {!Array.} usedBlockTypes Block types used in + * @param {!Array} usedBlockTypes Block types used in */ BlockExporterController.prototype.setUsedBlockTypes = function(usedBlockTypes) { diff --git a/demos/blockfactory/block_exporter_view.js b/demos/blockfactory/block_exporter_view.js index f505438a7..50d4262bc 100644 --- a/demos/blockfactory/block_exporter_view.js +++ b/demos/blockfactory/block_exporter_view.js @@ -70,7 +70,7 @@ BlockExporterView.prototype.deselectAllBlocks = function() { /** * Given an array of selected blocks, selects these blocks in the view, marking * the checkboxes accordingly. - * @param {Array.} blockTypes Array of block types to select. + * @param {Array} blockTypes Array of block types to select. */ BlockExporterView.prototype.setSelectedBlockTypes = function(blockTypes) { for (var i = 0, blockType; blockType = blockTypes[i]; i++) { @@ -80,7 +80,7 @@ BlockExporterView.prototype.setSelectedBlockTypes = function(blockTypes) { /** * Returns array of selected blocks. - * @return {!Array.} Array of all selected block types. + * @return {!Array} Array of all selected block types. */ BlockExporterView.prototype.getSelectedBlockTypes = function() { var selectedTypes = []; diff --git a/demos/blockfactory/block_library_controller.js b/demos/blockfactory/block_library_controller.js index 25156e9ce..c4ab6ac68 100644 --- a/demos/blockfactory/block_library_controller.js +++ b/demos/blockfactory/block_library_controller.js @@ -212,7 +212,7 @@ BlockLibraryController.prototype.hasEmptyBlockLibrary = function() { /** * Get all block types stored in block library. - * @return {!Array.} Array of block types. + * @return {!Array} Array of block types. */ BlockLibraryController.prototype.getStoredBlockTypes = function() { return this.storage.getBlockTypes(); diff --git a/demos/blockfactory/block_library_storage.js b/demos/blockfactory/block_library_storage.js index b0df067fa..38a822cb2 100644 --- a/demos/blockfactory/block_library_storage.js +++ b/demos/blockfactory/block_library_storage.js @@ -100,7 +100,7 @@ BlockLibraryStorage.prototype.getBlockXml = function(blockType) { /** * Returns map of each block type to its corresponding XML stored in current * block library (this.blocks). - * @param {!Array.} blockTypes Types of blocks. + * @param {!Array} blockTypes Types of blocks. * @return {!Object} Map of block type to corresponding XML. */ BlockLibraryStorage.prototype.getBlockXmlMap = function(blockTypes) { @@ -115,7 +115,7 @@ BlockLibraryStorage.prototype.getBlockXmlMap = function(blockTypes) { /** * Returns array of all block types stored in current block library. - * @return {!Array.} Array of block types stored in library. + * @return {!Array} Array of block types stored in library. */ BlockLibraryStorage.prototype.getBlockTypes = function() { return Object.keys(this.blocks); @@ -134,7 +134,7 @@ BlockLibraryStorage.prototype.isEmpty = function() { /** * Returns array of all block types stored in current block library. - * @return {!Array.} Map of block type to corresponding XML text. + * @return {!Array} Map of block type to corresponding XML text. */ BlockLibraryStorage.prototype.getBlockXmlTextMap = function() { return this.blocks; diff --git a/demos/blockfactory/factory_utils.js b/demos/blockfactory/factory_utils.js index 9d87857d4..93ca8ba97 100644 --- a/demos/blockfactory/factory_utils.js +++ b/demos/blockfactory/factory_utils.js @@ -377,7 +377,7 @@ FactoryUtils.connectionLineJs_ = function(functionName, typeName, workspace) { /** * Returns field strings and any config. * @param {!Blockly.Block} block Input block. - * @return {!Array.} Field strings. + * @return {!Array} Field strings. * @private */ FactoryUtils.getFieldsJs_ = function(block) { @@ -484,7 +484,7 @@ FactoryUtils.getFieldsJs_ = function(block) { /** * Returns field strings and any config. * @param {!Blockly.Block} block Input block. - * @return {!Array.} Array of static text and field configs. + * @return {!Array} Array of static text and field configs. * @private */ FactoryUtils.getFieldsJson_ = function(block) { @@ -614,7 +614,7 @@ FactoryUtils.getOptTypesFrom = function(block, name) { * Fetch the type(s) defined in the given input. * @param {!Blockly.Block} block Block with input. * @param {string} name Name of the input. - * @return {!Array.} List of types. + * @return {!Array} List of types. * @private */ FactoryUtils.getTypesFrom_ = function(block, name) { @@ -745,7 +745,7 @@ FactoryUtils.getBlockTypeFromJsDefinition = function(blockDef) { /** * Generates a category containing blocks of the specified block types. - * @param {!Array.} blocks Blocks to include in the category. + * @param {!Array} blocks Blocks to include in the category. * @param {string} categoryName Name to use for the generated category. * @return {!Element} Category XML containing the given block types. */ @@ -771,7 +771,7 @@ FactoryUtils.generateCategoryXml = function(blocks, categoryName) { * Parses a string containing JavaScript block definition(s) to create an array * in which each element is a single block definition. * @param {string} blockDefsString JavaScript block definition(s). - * @return {!Array.} Array of block definitions. + * @return {!Array} Array of block definitions. */ FactoryUtils.parseJsBlockDefinitions = function(blockDefsString) { var blockDefArray = []; @@ -797,7 +797,7 @@ FactoryUtils.parseJsBlockDefinitions = function(blockDefsString) { * JSON objects. * @param {string} blockDefsString String containing JSON block * definition(s). - * @return {!Array.} Array of block definitions. + * @return {!Array} Array of block definitions. */ FactoryUtils.parseJsonBlockDefinitions = function(blockDefsString) { var blockDefArray = []; @@ -827,7 +827,7 @@ FactoryUtils.parseJsonBlockDefinitions = function(blockDefsString) { * Define blocks from imported block definitions. * @param {string} blockDefsString Block definition(s). * @param {string} format Block definition format ('JSON' or 'JavaScript'). - * @return {!Array.} Array of block types defined. + * @return {!Array} Array of block types defined. */ FactoryUtils.defineAndGetBlockTypes = function(blockDefsString, format) { var blockTypes = []; diff --git a/demos/blockfactory/workspacefactory/wfactory_controller.js b/demos/blockfactory/workspacefactory/wfactory_controller.js index 11633f700..387c0ee98 100644 --- a/demos/blockfactory/workspacefactory/wfactory_controller.js +++ b/demos/blockfactory/workspacefactory/wfactory_controller.js @@ -1251,7 +1251,7 @@ WorkspaceFactoryController.prototype.importBlocks = function(file, format) { /** * Updates the block library category in the toolbox workspace toolbox. * @param {!Element} categoryXml XML for the block library category. - * @param {!Array.} libBlockTypes Array of block types from the block + * @param {!Array} libBlockTypes Array of block types from the block * library. */ WorkspaceFactoryController.prototype.setBlockLibCategory = @@ -1278,7 +1278,7 @@ WorkspaceFactoryController.prototype.setBlockLibCategory = /** * Return the block types used in the custom toolbox and pre-loaded workspace. - * @return {!Array.} Block types used in the custom toolbox and + * @return {!Array} Block types used in the custom toolbox and * pre-loaded workspace. */ WorkspaceFactoryController.prototype.getAllUsedBlockTypes = function() { diff --git a/demos/blockfactory/workspacefactory/wfactory_generator.js b/demos/blockfactory/workspacefactory/wfactory_generator.js index 96c142adb..0e583657c 100644 --- a/demos/blockfactory/workspacefactory/wfactory_generator.js +++ b/demos/blockfactory/workspacefactory/wfactory_generator.js @@ -212,8 +212,8 @@ WorkspaceFactoryGenerator.prototype.setShadowBlocksInHiddenWorkspace_ = /** * Given a set of block types, gets the Blockly.Block objects for each block * type. - * @param {!Array.} blockTypes Array of blocks that have been defined. - * @return {!Array.} Array of Blockly.Block objects corresponding + * @param {!Array} blockTypes Array of blocks that have been defined. + * @return {!Array} Array of Blockly.Block objects corresponding * to the array of blockTypes. */ WorkspaceFactoryGenerator.prototype.getDefinedBlocks = function(blockTypes) { diff --git a/demos/blockfactory/workspacefactory/wfactory_model.js b/demos/blockfactory/workspacefactory/wfactory_model.js index fcd62e2dd..0e9ad783b 100644 --- a/demos/blockfactory/workspacefactory/wfactory_model.js +++ b/demos/blockfactory/workspacefactory/wfactory_model.js @@ -246,7 +246,7 @@ WorkspaceFactoryModel.prototype.getSelectedXml = function() { /** * Return ordered list of ListElement objects. - * @return {!Array.} ordered list of ListElement objects + * @return {!Array} ordered list of ListElement objects */ WorkspaceFactoryModel.prototype.getToolboxList = function() { return this.toolboxList; @@ -383,7 +383,7 @@ WorkspaceFactoryModel.prototype.setOptions = function(options) { * Returns an array of all the block types currently being used in the toolbox * and the pre-loaded blocks. No duplicates. * TODO(evd2014): Move pushBlockTypesToList to FactoryUtils. - * @return {!Array.} Array of block types currently being used. + * @return {!Array} Array of block types currently being used. */ WorkspaceFactoryModel.prototype.getAllUsedBlockTypes = function() { var blockTypeList = []; @@ -424,7 +424,7 @@ WorkspaceFactoryModel.prototype.getAllUsedBlockTypes = function() { /** * Adds new imported block types to the list of current imported block types. - * @param {!Array.} blockTypes Array of block types imported. + * @param {!Array} blockTypes Array of block types imported. */ WorkspaceFactoryModel.prototype.addImportedBlockTypes = function(blockTypes) { this.importedBlockTypes = this.importedBlockTypes.concat(blockTypes); @@ -432,7 +432,7 @@ WorkspaceFactoryModel.prototype.addImportedBlockTypes = function(blockTypes) { /** * Updates block types in block library. - * @param {!Array.} blockTypes Array of block types in block library. + * @param {!Array} blockTypes Array of block types in block library. */ WorkspaceFactoryModel.prototype.updateLibBlockTypes = function(blockTypes) { this.libBlockTypes = blockTypes; @@ -454,7 +454,7 @@ WorkspaceFactoryModel.prototype.isDefinedBlockType = function(blockType) { /** * Checks if any of the block types are already defined. - * @param {!Array.} blockTypes Array of block types. + * @param {!Array} blockTypes Array of block types. * @return {boolean} True if a block type in the array is already defined, * false if none of the blocks are already defined. */ diff --git a/demos/blockfactory/workspacefactory/wfactory_view.js b/demos/blockfactory/workspacefactory/wfactory_view.js index 0384becdd..cf1681e58 100644 --- a/demos/blockfactory/workspacefactory/wfactory_view.js +++ b/demos/blockfactory/workspacefactory/wfactory_view.js @@ -294,7 +294,7 @@ WorkspaceFactoryView.prototype.clearToolboxTabs = function() { * Given a set of blocks currently loaded user-generated shadow blocks, visually * marks them without making them actual shadow blocks (allowing them to still * be editable and movable). - * @param {!Array.} blocks Array of user-generated shadow blocks + * @param {!Array} blocks Array of user-generated shadow blocks * currently loaded. */ WorkspaceFactoryView.prototype.markShadowBlocks = function(blocks) { diff --git a/demos/blockfactory_old/factory.js b/demos/blockfactory_old/factory.js index 541de63ae..a324a567e 100644 --- a/demos/blockfactory_old/factory.js +++ b/demos/blockfactory_old/factory.js @@ -278,7 +278,7 @@ function connectionLineJs_(functionName, typeName) { /** * Returns field strings and any config. * @param {!Blockly.Block} block Input block. - * @return {!Array.} Field strings. + * @return {!Array} Field strings. * @private */ function getFieldsJs_(block) { @@ -374,7 +374,7 @@ function getFieldsJs_(block) { /** * Returns field strings and any config. * @param {!Blockly.Block} block Input block. - * @return {!Array.} Array of static text and field configs. + * @return {!Array} Array of static text and field configs. * @private */ function getFieldsJson_(block) { @@ -504,7 +504,7 @@ function getOptTypesFrom(block, name) { * Fetch the type(s) defined in the given input. * @param {!Blockly.Block} block Block with input. * @param {string} name Name of the input. - * @return {!Array.} List of types. + * @return {!Array} List of types. * @private */ function getTypesFrom_(block, name) { diff --git a/demos/graph/index.html b/demos/graph/index.html index 2e68c8475..da2922e0f 100644 --- a/demos/graph/index.html +++ b/demos/graph/index.html @@ -298,7 +298,7 @@ Graph.drawVisualization = function() { /** * Plot points on the function y = f(x). * @param {string} code JavaScript code. - * @return {!Array.} 2D Array of points on the graph. + * @return {!Array} 2D Array of points on the graph. */ Graph.plot = function(code) { // Initialize a table with two column headings. diff --git a/demos/plane/soy/soyutils.js b/demos/plane/soy/soyutils.js index e18764c91..ca9191612 100644 --- a/demos/plane/soy/soyutils.js +++ b/demos/plane/soy/soyutils.js @@ -613,7 +613,7 @@ goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) { // directly to avoid arguments instantiation, another 2x improvement. this.buffer_[this.bufferLength_++] = a1; } else { - var arr = /**@type {Array.}*/(this.buffer_); + var arr = /**@type {Array}*/(this.buffer_); arr.push.apply(arr, arguments); this.bufferLength_ = this.buffer_.length; } @@ -1656,7 +1656,7 @@ soy.$$checkMapKey = function(key) { /** * Gets the keys in a map as an array. There are no guarantees on the order. * @param {Object} map The map to get the keys of. - * @return {Array.} The array of keys in the given map. + * @return {Array} The array of keys in the given map. */ soy.$$getMapKeys = function(map) { var mapKeys = []; @@ -1779,9 +1779,9 @@ soy.$$getDelegateFn = function( * Private helper soy.$$getDelegateFn(). This is the empty template function * that is returned whenever there's no delegate implementation found. * - * @param {Object.=} opt_data + * @param {Object=} opt_data * @param {soy.StringBuilder=} opt_sb - * @param {Object.=} opt_ijData + * @param {Object=} opt_ijData * @return {string} * @private */ @@ -2052,7 +2052,7 @@ soy.$$HTML5_VOID_ELEMENTS_ = new RegExp( * * @param {*} value The HTML to be escaped. May not be a string, but the * value will be coerced to a string. - * @param {Object.=} opt_tagAllowlist Has an own property whose + * @param {Object=} opt_tagAllowlist Has an own property whose * name is a lower-case tag name and whose value is {@code 1} for * each element that is allowed in the output. * @return {string} A representation of value without disallowed tags, @@ -2118,7 +2118,7 @@ soy.$$stripHtmlTags = function(value, opt_tagAllowlist) { * If {@code } is used for formatting, embedded HTML shouldn't be able * to use a mismatched {@code
} to break page layout. * - * @param {Array.} tags an array of tags that will be modified in place + * @param {Array} tags an array of tags that will be modified in place * include tags, the empty string, or concatenations of empty tags. * @return {string} zero or more closed tags that close all elements that are * opened in tags but not closed. @@ -2575,7 +2575,7 @@ soy.$$isLowSurrogate_ = function(ch) { /** * Cache of bidi formatter by context directionality, so we don't keep on * creating new objects. - * @type {!Object.} + * @type {!Object} * @private */ soy.$$bidiFormatterCache_ = {}; @@ -2799,7 +2799,7 @@ soy.esc.$$escapeUriHelper = function(v) { /** * Maps characters to the escaped versions for the named escape directives. - * @type {Object.} + * @type {Object} * @private */ soy.esc.$$ESCAPE_MAP_FOR_ESCAPE_HTML__AND__NORMALIZE_HTML__AND__ESCAPE_HTML_NOSPACE__AND__NORMALIZE_HTML_NOSPACE_ = { @@ -2837,7 +2837,7 @@ soy.esc.$$REPLACER_FOR_ESCAPE_HTML__AND__NORMALIZE_HTML__AND__ESCAPE_HTML_NOSPAC /** * Maps characters to the escaped versions for the named escape directives. - * @type {Object.} + * @type {Object} * @private */ soy.esc.$$ESCAPE_MAP_FOR_ESCAPE_JS_STRING__AND__ESCAPE_JS_REGEX_ = { @@ -2889,7 +2889,7 @@ soy.esc.$$REPLACER_FOR_ESCAPE_JS_STRING__AND__ESCAPE_JS_REGEX_ = function(ch) { /** * Maps characters to the escaped versions for the named escape directives. - * @type {Object.} + * @type {Object} * @private */ soy.esc.$$ESCAPE_MAP_FOR_ESCAPE_CSS_STRING_ = { @@ -2934,7 +2934,7 @@ soy.esc.$$REPLACER_FOR_ESCAPE_CSS_STRING_ = function(ch) { /** * Maps characters to the escaped versions for the named escape directives. - * @type {Object.} + * @type {Object} * @private */ soy.esc.$$ESCAPE_MAP_FOR_NORMALIZE_URI__AND__FILTER_NORMALIZE_URI_ = { @@ -3291,7 +3291,7 @@ soy.esc.$$LT_REGEX_ = /} + * @type {Object} * @private */ soy.esc.$$SAFE_TAG_ALLOWLIST_ = {'b': 1, 'br': 1, 'em': 1, 'i': 1, 's': 1, 'sub': 1, 'sup': 1, 'u': 1}; diff --git a/generators/javascript.js b/generators/javascript.js index f1cbe4819..a12a64123 100644 --- a/generators/javascript.js +++ b/generators/javascript.js @@ -85,7 +85,7 @@ Blockly.JavaScript.ORDER_NONE = 99; // (...) /** * List of outer-inner pairings that do NOT require parentheses. - * @type {!Array.>} + * @type {!Array>} */ Blockly.JavaScript.ORDER_OVERRIDES = [ // (foo()).bar -> foo().bar diff --git a/generators/php.js b/generators/php.js index 2e29f4897..f8209349f 100644 --- a/generators/php.js +++ b/generators/php.js @@ -97,7 +97,7 @@ Blockly.PHP.ORDER_NONE = 99; // (...) /** * List of outer-inner pairings that do NOT require parentheses. - * @type {!Array.>} + * @type {!Array>} */ Blockly.PHP.ORDER_OVERRIDES = [ // (foo()).bar() -> foo().bar() diff --git a/generators/python.js b/generators/python.js index f0390f580..764df8b0b 100644 --- a/generators/python.js +++ b/generators/python.js @@ -101,7 +101,7 @@ Blockly.Python.ORDER_NONE = 99; // (...) /** * List of outer-inner pairings that do NOT require parentheses. - * @type {!Array.>} + * @type {!Array>} */ Blockly.Python.ORDER_OVERRIDES = [ // (foo()).bar -> foo().bar @@ -138,19 +138,16 @@ Blockly.Python.isInitialized = false; * @this {Blockly.Generator} */ Blockly.Python.init = function(workspace) { + // Call Blockly.Generator's init. + Object.getPrototypeOf(this).init.call(this); + /** * Empty loops or conditionals are not allowed in Python. */ Blockly.Python.PASS = this.INDENT + 'pass\n'; - // Create a dictionary of definitions to be printed before the code. - Blockly.Python.definitions_ = Object.create(null); - // Create a dictionary mapping desired function names in definitions_ - // to actual function names (to avoid collisions with user functions). - Blockly.Python.functionNames_ = Object.create(null); if (!Blockly.Python.nameDB_) { - Blockly.Python.nameDB_ = - new Blockly.Names(Blockly.Python.RESERVED_WORDS_); + Blockly.Python.nameDB_ = new Blockly.Names(Blockly.Python.RESERVED_WORDS_); } else { Blockly.Python.nameDB_.reset(); } @@ -193,9 +190,10 @@ Blockly.Python.finish = function(code) { definitions.push(def); } } - // Clean up temporary data. - delete Blockly.Python.definitions_; - delete Blockly.Python.functionNames_; + // Call Blockly.Generator's finish. + code = Object.getPrototypeOf(this).finish.call(this, code); + this.isInitialized = false; + Blockly.Python.nameDB_.reset(); var allDefs = imports.join('\n') + '\n\n' + definitions.join('\n\n'); return allDefs.replace(/\n\n+/g, '\n\n').replace(/\n*$/, '\n\n\n') + code; diff --git a/generators/python/logic.js b/generators/python/logic.js index 67e06ac35..f01a20b8a 100644 --- a/generators/python/logic.js +++ b/generators/python/logic.js @@ -33,7 +33,7 @@ Blockly.Python['controls_if'] = function(block) { Blockly.Python.injectId(Blockly.Python.STATEMENT_SUFFIX, block), Blockly.Python.INDENT) + branchCode; } - code += (n == 0 ? 'if ' : 'elif ' ) + conditionCode + ':\n' + branchCode; + code += (n == 0 ? 'if ' : 'elif ') + conditionCode + ':\n' + branchCode; ++n; } while (block.getInput('IF' + n)); diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 40adbbaab..33a04fcee 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -133,7 +133,7 @@ function compile(compilerOptions, opt_verbose, opt_warnings_as_error, /** * Helper method for possibly adding the Closure library into a sources array. - * @param {Array.} srcs + * @param {Array} srcs */ function maybeAddClosureLibrary(srcs) { if (argv.closureLibrary) { @@ -155,7 +155,7 @@ function maybeAddClosureLibrary(srcs) { * A helper method to return an closure compiler output wrapper that wraps the * body in a Universal Module Definition. * @param {string} namespace The export namespace. - * @param {Array.} dependencies An array of dependencies to inject. + * @param {Array} dependencies An array of dependencies to inject. */ function outputWrapperUMD(namespace, dependencies) { const amdDeps = dependencies.map(d => '\'' + d.amd + '\'' ).join(', '); diff --git a/scripts/gulpfiles/package_tasks.js b/scripts/gulpfiles/package_tasks.js index 94754617f..bf79b7a6e 100644 --- a/scripts/gulpfiles/package_tasks.js +++ b/scripts/gulpfiles/package_tasks.js @@ -28,7 +28,7 @@ const packageDistribution = 'dist'; /** * A helper method for wrapping a file into a Universal Module Definition. * @param {string} namespace The export namespace. - * @param {Array.} dependencies An array of dependencies to inject. + * @param {Array} dependencies An array of dependencies to inject. */ function packageUMD(namespace, dependencies) { return gulp.umd({ @@ -42,7 +42,7 @@ function packageUMD(namespace, dependencies) { /** * A helper method for wrapping a file into a CommonJS module for Node.js. * @param {string} namespace The export namespace. - * @param {Array.} dependencies An array of dependencies to inject. + * @param {Array} dependencies An array of dependencies to inject. */ function packageCommonJS(namespace, dependencies) { return gulp.umd({