Resolve another 20 warnings.

This commit is contained in:
Neil Fraser
2017-10-24 09:14:32 -07:00
committed by Neil Fraser
parent 4262b09002
commit 2445a752b7
11 changed files with 33 additions and 44 deletions

View File

@@ -22,7 +22,7 @@ before_install:
before_script:
- export DISPLAY=:99.0
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ( tests/scripts/setup_linux_env.sh ) fi
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ( tests/scripts/setup_linux_env.sh ) fi
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then ( tests/scripts/setup_osx_env.sh ) fi
- sleep 2

View File

@@ -751,10 +751,10 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
Blockly.Constants.Text.TEXT_JOIN_EXTENSION = function() {
// Add the quote mixin for the itemCount_ = 0 case.
this.mixin(Blockly.Constants.Text.QUOTE_IMAGE_MIXIN);
// initialize the mutator values
// Initialize the mutator values.
this.itemCount_ = 2;
this.updateShape_();
// Configure the mutator ui
// Configure the mutator UI.
this.setMutator(new Blockly.Mutator(['text_create_join_item']));
};

View File

@@ -293,10 +293,11 @@ Blockly.Block.prototype.unplug = function(opt_healStack) {
/**
* Returns all connections originating from this block.
* @param {boolean} all If true, return all connections even hidden ones.
* @return {!Array.<!Blockly.Connection>} Array of connections.
* @private
*/
Blockly.Block.prototype.getConnections_ = function() {
Blockly.Block.prototype.getConnections_ = function(all) {
var myConnections = [];
if (this.outputConnection) {
myConnections.push(this.outputConnection);
@@ -1423,8 +1424,10 @@ Blockly.Block.prototype.setCommentText = function(text) {
/**
* Set this block's warning text.
* @param {?string} text The text, or null to delete.
* @param {string=} opt_id An optional ID for the warning text to be able to
* maintain multiple warnings.
*/
Blockly.Block.prototype.setWarningText = function(/* text */) {
Blockly.Block.prototype.setWarningText = function(text, opt_id) {
// NOP.
};
@@ -1432,7 +1435,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

@@ -305,7 +305,7 @@ Blockly.Events.fromJson = function(json, workspace) {
event = new Blockly.Events.Delete(null);
break;
case Blockly.Events.CHANGE:
event = new Blockly.Events.Change(null);
event = new Blockly.Events.Change(null, '', null, null, null);
break;
case Blockly.Events.MOVE:
event = new Blockly.Events.Move(null);
@@ -317,7 +317,7 @@ Blockly.Events.fromJson = function(json, workspace) {
event = new Blockly.Events.VarDelete(null);
break;
case Blockly.Events.VAR_RENAME:
event = new Blockly.Events.VarRename(null);
event = new Blockly.Events.VarRename(null, '');
break;
case Blockly.Events.UI:
event = new Blockly.Events.Ui(null);
@@ -573,8 +573,8 @@ Blockly.Events.Delete.prototype.run = function(forward) {
* @param {Blockly.Block} block The changed block. Null for a blank event.
* @param {string} element One of 'field', 'comment', 'disabled', etc.
* @param {?string} name Name of input or field affected, or null.
* @param {string} oldValue Previous value of element.
* @param {string} newValue New value of element.
* @param {*} oldValue Previous value of element.
* @param {*} newValue New value of element.
* @extends {Blockly.Events.Abstract}
* @constructor
*/
@@ -595,8 +595,8 @@ goog.inherits(Blockly.Events.Change, Blockly.Events.Abstract);
* @param {Blockly.Block} block The changed block. Null for a blank event.
* @param {string} element One of 'field', 'comment', 'disabled', etc.
* @param {?string} name Name of input or field affected, or null.
* @param {string} oldValue Previous value of element.
* @param {string} newValue New value of element.
* @param {*} oldValue Previous value of element.
* @param {*} newValue New value of element.
* @extends {Blockly.Events.Abstract}
* @constructor
*/

View File

@@ -322,7 +322,7 @@ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName,
// Wait for load, in case Blockly.Msg is not yet populated.
// runAfterPageLoad() does not run in a Node.js environment due to lack of
// document object, in which case skip the validation.
if (document) { // Relies on document.readyState
if (document) { // Relies on document.readyState
Blockly.utils.runAfterPageLoad(function() {
for (var key in lookupTable) {
// Will print warnings if reference is missing.

View File

@@ -188,7 +188,7 @@ Blockly.VerticalFlyout.prototype.setBackgroundPath_ = function(width, height) {
atRight ? this.CORNER_RADIUS : -this.CORNER_RADIUS,
this.CORNER_RADIUS);
// Bottom.
path.push('h', atRight ? width : -width);
path.push('h', atRight ? width : -width);
path.push('z');
this.svgBackground_.setAttribute('d', path.join(' '));
};

View File

@@ -497,8 +497,7 @@ Blockly.Workspace.prototype.undo = function(redo) {
for (var i = 0, event; event = events[i]; i++) {
event.run(redo);
}
}
finally {
} finally {
Blockly.Events.recordUndo = true;
}
};

View File

@@ -1357,7 +1357,7 @@ Blockly.WorkspaceSvg.prototype.setBrowserFocus = function() {
try {
// Focus the workspace SVG - this is for Chrome and Firefox.
this.getParentSvg().focus();
} catch (e) {
} catch (e) {
// IE and Edge do not support focus on SVG elements. When that fails
// above, get the injectionDiv (the workspace's parent) and focus that
// instead. This doesn't work in Chrome.

View File

@@ -353,11 +353,10 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
} else if (name == 'shadow') {
goog.asserts.fail('Shadow block cannot be a top-level block.');
variablesFirst = false;
} else if (name == 'variables') {
} else if (name == 'variables') {
if (variablesFirst) {
Blockly.Xml.domToVariables(xmlChild, workspace);
}
else {
} else {
throw Error('\'variables\' tag must exist once before block and ' +
'shadow tag elements in the workspace XML, but it was found in ' +
'another location.');
@@ -365,8 +364,7 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
variablesFirst = false;
}
}
}
finally {
} finally {
if (!existingGroup) {
Blockly.Events.setGroup(false);
}

View File

@@ -131,8 +131,7 @@ function test_createVariableNullId() {
try {
variable_map.createVariable('name1', 'type1', null);
checkVariableValues(variable_map, 'name1', 'type1', '1');
}
finally {
} finally {
variableMapTest_tearDown();
}
}
@@ -143,8 +142,7 @@ function test_createVariableUndefinedId() {
try {
variable_map.createVariable('name1', 'type1', undefined);
checkVariableValues(variable_map, 'name1', 'type1', '1');
}
finally {
} finally {
variableMapTest_tearDown();
}
}

View File

@@ -66,8 +66,7 @@ function test_emptyWorkspace() {
assertEquals('Empty workspace (4).', 0, workspace.getTopBlocks(true).length);
assertEquals('Empty workspace (5).', 0, workspace.getTopBlocks(false).length);
assertEquals('Empty workspace (6).', 0, workspace.getAllBlocks().length);
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -187,8 +186,7 @@ function test_updateVariableStore_TrivialNoClear() {
workspace.updateVariableStore();
checkVariableValues(workspace, 'name1', 'type1', 'id1');
checkVariableValues(workspace, 'name2', 'type2', 'id2');
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -202,8 +200,7 @@ function test_updateVariableStore_NameNotInvariableMap_NoClear() {
try {
workspace.updateVariableStore();
checkVariableValues(workspace, 'name1', '', '1');
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -219,8 +216,7 @@ function test_updateVariableStore_ClearAndAllInUse() {
workspace.updateVariableStore(true);
checkVariableValues(workspace, 'name1', 'type1', 'id1');
checkVariableValues(workspace, 'name2', 'type2', 'id2');
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -237,8 +233,7 @@ function test_updateVariableStore_ClearAndOneInUse() {
checkVariableValues(workspace, 'name1', 'type1', 'id1');
var variabe = workspace.getVariable('name2');
assertNull(variable);
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -255,8 +250,7 @@ function test_addTopBlock_TrivialFlyoutIsTrue() {
try {
workspace.addTopBlock(block);
checkVariableValues(workspace, 'name1', '', '1');
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -274,8 +268,7 @@ function test_clear_Trivial() {
var varMapLength = Object.keys(workspace.variableMap_.variableMap_).length;
assertEquals(0, topBlocks_length);
assertEquals(0, varMapLength);
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -291,8 +284,7 @@ function test_clear_NoVariables() {
var varMapLength = Object.keys(workspace.variableMap_.variableMap_).length;
assertEquals(0, topBlocks_length);
assertEquals(0, varMapLength);
}
finally {
} finally {
workspaceTest_tearDown();
}
}
@@ -312,8 +304,7 @@ function test_renameVariable_NoBlocks() {
checkVariableValues(workspace, 'name2', '', '1');
var variable = workspace.getVariable(oldName);
assertNull(variable);
}
finally {
} finally {
workspaceTest_tearDown();
}
}