Update some inline docs in block.js (#4241)

* Update some inline docs in block.js

* Fix build error
This commit is contained in:
Beka Westberg
2020-09-01 10:27:17 -07:00
committed by GitHub
parent 739b8b3adc
commit af9be6d9c3
3 changed files with 13 additions and 9 deletions

View File

@@ -38,13 +38,13 @@ goog.requireType('Blockly.IASTNodeLocation');
* Class for one block.
* Not normally called directly, workspace.newBlock() is preferred.
* @param {!Blockly.Workspace} workspace The block's workspace.
* @param {?string} prototypeName Name of the language object containing
* @param {!string} prototypeName Name of the language object containing
* type-specific functions for this block.
* @param {string=} opt_id Optional ID. Use this ID if provided, otherwise
* create a new ID.
* @constructor
* @implements {Blockly.IASTNodeLocation}
* @throws When block is not valid or block name is not allowed.
* @throws When the prototypeName is not valid or not allowed.
*/
Blockly.Block = function(workspace, prototypeName, opt_id) {
if (Blockly.Generator &&
@@ -1070,9 +1070,9 @@ Blockly.Block.prototype.renameVarById = function(oldId, newId) {
};
/**
* Returns the language-neutral value from the field of a block.
* Returns the language-neutral value of the given field.
* @param {string} name The name of the field.
* @return {*} Value from the field or null if field does not exist.
* @return {*} Value of the field or null if field does not exist.
*/
Blockly.Block.prototype.getFieldValue = function(name) {
var field = this.getField(name);
@@ -1083,9 +1083,9 @@ Blockly.Block.prototype.getFieldValue = function(name) {
};
/**
* Change the field value for a block (e.g. 'CHOOSE' or 'REMOVE').
* @param {string} newValue Value to be the new field.
* @param {string} name The name of the field.
* Sets the value of the given field for this block.
* @param {*} newValue The value to set.
* @param {!string} name The name of the field to set the value of.
*/
Blockly.Block.prototype.setFieldValue = function(newValue, name) {
var field = this.getField(name);

View File

@@ -492,7 +492,7 @@ Blockly.Workspace.prototype.getWidth = function() {
/**
* Obtain a newly created block.
* @param {?string} prototypeName Name of the language object containing
* @param {!string} prototypeName Name of the language object containing
* type-specific functions for this block.
* @param {string=} opt_id Optional ID. Use this ID if provided, otherwise
* create a new ID.

View File

@@ -884,7 +884,11 @@ Blockly.WorkspaceSvg.prototype.dispose = function() {
/**
* Obtain a newly created block.
* @param {?string} prototypeName Name of the language object containing
*
* This block's svg must still be initialized
* ([initSvg]{@link Blockly.BlockSvg#initSvg}) and it must be rendered
* ([render]{@link Blockly.BlockSvg#render}) before the block will be visible.
* @param {!string} prototypeName Name of the language object containing
* type-specific functions for this block.
* @param {string=} opt_id Optional ID. Use this ID if provided, otherwise
* create a new ID.