Merge pull request #912 from rachel-fenichel/lint

Fix some lint errors
This commit is contained in:
Rachel Fenichel
2017-02-06 12:39:45 -08:00
committed by GitHub
14 changed files with 27 additions and 28 deletions

View File

@@ -256,7 +256,7 @@ Blockly.Blocks['controls_flow_statements'] = {
* @param {!Blockly.Events.Abstract} e Change event.
* @this Blockly.Block
*/
onchange: function(e) {
onchange: function(/* e */) {
if (!this.workspace.isDragging || this.workspace.isDragging()) {
return; // Don't change state at the start of a drag.
}

View File

@@ -412,7 +412,7 @@ Blockly.Blocks.math.TOOLTIPS_BY_OP_ = {
'MEDIAN': '%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}',
'MODE': '%{BKY_MATH_ONLIST_TOOLTIP_MODE}',
'STD_DEV': '%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}',
'RANDOM': '%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}',
'RANDOM': '%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}'
};
Blockly.Extensions.register("math_op_tooltip",
Blockly.Extensions.buildTooltipForDropdown(

View File

@@ -120,7 +120,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
},
/**
* Create XML to represent the argument inputs.
* @param {=boolean} opt_paramIds If true include the IDs of the parameter
* @param {boolean=} opt_paramIds If true include the IDs of the parameter
* quarks. Used by Blockly.Procedures.mutateCallers for reconnection.
* @return {!Element} XML storage element.
* @this Blockly.Block
@@ -679,6 +679,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
/**
* Procedure calls cannot exist without the corresponding procedure
* definition. Enforce this link whenever an event is fired.
* @param {!Blockly.Events.Abstract} event Change event.
* @this Blockly.Block
*/
onchange: function(event) {
@@ -840,7 +841,7 @@ Blockly.Blocks['procedures_ifreturn'] = {
* @param {!Blockly.Events.Abstract} e Change event.
* @this Blockly.Block
*/
onchange: function(e) {
onchange: function(/* e */) {
if (!this.workspace.isDragging || this.workspace.isDragging()) {
return; // Don't change state at the start of a drag.
}

View File

@@ -742,7 +742,7 @@ Blockly.Blocks['text_replace'] = {
"type": "input_value",
"name": "TEXT",
"check": "String"
},
}
],
"output": "String",
"inputsInline": true,
@@ -766,7 +766,7 @@ Blockly.Blocks['text_reverse'] = {
"type": "input_value",
"name": "TEXT",
"check": "String"
},
}
],
"output": "String",
"inputsInline": true,

View File

@@ -1366,7 +1366,7 @@ Blockly.Block.prototype.setCommentText = function(text) {
* Set this block's warning text.
* @param {?string} text The text, or null to delete.
*/
Blockly.Block.prototype.setWarningText = function(text) {
Blockly.Block.prototype.setWarningText = function(/* text */) {
// NOP.
};
@@ -1374,7 +1374,7 @@ Blockly.Block.prototype.setWarningText = function(text) {
* Give this block a mutator dialog.
* @param {Blockly.Mutator} mutator A mutator dialog instance or null to remove.
*/
Blockly.Block.prototype.setMutator = function(mutator) {
Blockly.Block.prototype.setMutator = function(/* mutator */) {
// NOP.
};

View File

@@ -27,6 +27,6 @@
/**
* A mapping of block type names to block prototype objects.
* @name Blockly.Blocks
* @type {!Object<string,Object>}
* @type {!Object<string,Object>}
*/
goog.provide('Blockly.Blocks');

View File

@@ -307,7 +307,7 @@ Blockly.Events.Abstract = function(block) {
*/
Blockly.Events.Abstract.prototype.toJson = function() {
var json = {
'type': this.type,
'type': this.type
};
if (this.blockId) {
json['blockId'] = this.blockId;

View File

@@ -31,7 +31,7 @@ goog.require('goog.math');
/**
* Class for an editable number field.
* @param {(string|number)=} value The initial content of the field. The value
* @param {(string|number)=} opt_value The initial content of the field. The value
* should cast to a number, and if it does not, '0' will be used.
* @param {(string|number)=} opt_min Minimum value.
* @param {(string|number)=} opt_max Maximum value.
@@ -43,8 +43,8 @@ goog.require('goog.math');
* @extends {Blockly.FieldTextInput}
* @constructor
*/
Blockly.FieldNumber =
function(opt_value, opt_min, opt_max, opt_precision, opt_validator) {
Blockly.FieldNumber = function(opt_value, opt_min, opt_max, opt_precision,
opt_validator) {
opt_value = (opt_value && !isNaN(opt_value)) ? String(opt_value) : '0';
Blockly.FieldNumber.superClass_.constructor.call(
this, opt_value, opt_validator);

View File

@@ -125,7 +125,7 @@ Blockly.FieldVariable.prototype.setValue = function(newValue) {
* 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.<string>} Array of variable names.
* @this {!Blockly.FieldVariable}
* @this {Blockly.FieldVariable}
*/
Blockly.FieldVariable.dropdownCreate = function() {
if (this.sourceBlock_ && this.sourceBlock_.workspace) {
@@ -164,7 +164,6 @@ Blockly.FieldVariable.dropdownCreate = function() {
* @param {!goog.ui.MenuItem} menuItem The MenuItem selected within menu.
*/
Blockly.FieldVariable.prototype.onItemSelected = function(menu, menuItem) {
var menuLength = menu.getChildCount();
var itemText = menuItem.getValue();
if (this.sourceBlock_) {
var workspace = this.sourceBlock_.workspace;

View File

@@ -132,7 +132,7 @@ Blockly.Procedures.isLegalName_ = function(name, workspace, opt_exclude) {
* Rename a procedure. Called by the editable field.
* @param {string} name The proposed new name.
* @return {string} The accepted name.
* @this {!Blockly.Field}
* @this {Blockly.Field}
*/
Blockly.Procedures.rename = function(name) {
// Strip leading and trailing whitespace. Beyond this, all names are legal.

View File

@@ -364,9 +364,9 @@ Blockly.Scrollbar.prototype.setScrollViewSize_ = function(newSize) {
};
/**
+ * Set whether this scrollbar's container is visible.
+ * @param {boolean} visible Whether the container is visible.
+ */
* Set whether this scrollbar's container is visible.
* @param {boolean} visible Whether the container is visible.
*/
Blockly.ScrollbarPair.prototype.setContainerVisible = function(visible) {
this.hScroll.setContainerVisible(visible);
this.vScroll.setContainerVisible(visible);
@@ -646,7 +646,7 @@ Blockly.Scrollbar.prototype.setVisible = function(visible) {
* We cannot rely on the containing workspace being hidden to hide us
* because it is not necessarily our parent in the dom.
*/
Blockly.Scrollbar.prototype.updateDisplay_ = function() {
Blockly.Scrollbar.prototype.updateDisplay_ = function() {
var show = true;
// Check whether our parent/container is visible.
if (!this.containerVisible_) {

View File

@@ -241,7 +241,6 @@ Blockly.Toolbox.prototype.position = function() {
return;
}
var svg = this.workspace_.getParentSvg();
var svgPosition = goog.style.getPageOffset(svg);
var svgSize = Blockly.svgSize(svg);
if (this.horizontalLayout_) {
treeDiv.style.left = '0';
@@ -633,8 +632,8 @@ Blockly.Toolbox.TreeNode.prototype.onDoubleClick_ = function(e) {
Blockly.Toolbox.TreeNode.prototype.onKeyDown = function(e) {
if (this.tree.toolbox_.horizontalLayout_) {
var map = {};
var next = goog.events.KeyCodes.DOWN
var prev = goog.events.KeyCodes.UP
var next = goog.events.KeyCodes.DOWN;
var prev = goog.events.KeyCodes.UP;
map[goog.events.KeyCodes.RIGHT] = this.rightToLeft_ ? prev : next;
map[goog.events.KeyCodes.LEFT] = this.rightToLeft_ ? next : prev;
map[goog.events.KeyCodes.UP] = goog.events.KeyCodes.LEFT;

View File

@@ -854,8 +854,8 @@ Blockly.utils.runAfterPageLoad = function(fn) {
// Poll readyState.
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === 'complete') {
clearInterval(readyStateCheckInterval);
fn();
clearInterval(readyStateCheckInterval);
fn();
}
}, 10);
}

View File

@@ -211,7 +211,7 @@ Blockly.WorkspaceSvg.prototype.workspaceDragSurface_ = null;
* @type {boolean}
* @private
*/
Blockly.WorkspaceSvg.prototype.useWorkspaceDragSurface_ = false;
Blockly.WorkspaceSvg.prototype.useWorkspaceDragSurface_ = false;
/**
* Whether the drag surface is actively in use. When true, calls to
@@ -688,8 +688,8 @@ Blockly.WorkspaceSvg.prototype.setupDragSurface = function() {
// Figure out where we want to put the canvas back. The order
// in the is important because things are layered.
var previousElement = this.svgBlockCanvas_.previousSibling;
var width = this.getParentSvg().getAttribute("width")
var height = this.getParentSvg().getAttribute("height")
var width = this.getParentSvg().getAttribute("width");
var height = this.getParentSvg().getAttribute("height");
var coord = Blockly.utils.getRelativeXY(this.svgBlockCanvas_);
this.workspaceDragSurface_.setContentsAndShow(this.svgBlockCanvas_,
this.svgBubbleCanvas_, previousElement, width, height, this.scale);