Fix warnings related to number of arguments passed. (#3270)

This commit is contained in:
Sam El-Husseini
2019-10-17 11:47:30 -05:00
committed by GitHub
parent 526528354f
commit 664cc3d6cd
8 changed files with 16 additions and 13 deletions

View File

@@ -942,7 +942,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
var def = Blockly.Procedures.getDefinition(name, this.workspace);
if (!def) {
Blockly.Events.setGroup(event.group);
this.dispose(true, false);
this.dispose(true);
Blockly.Events.setGroup(false);
}
} else if (event.type == Blockly.Events.CHANGE && event.element == 'disabled') {

View File

@@ -577,7 +577,7 @@ Blockly.BlockSvg.prototype.snapToGrid = function() {
* @return {!Blockly.utils.Rect} Object with coordinates of the bounding box.
*/
Blockly.BlockSvg.prototype.getBoundingRectangle = function() {
var blockXY = this.getRelativeToSurfaceXY(this);
var blockXY = this.getRelativeToSurfaceXY();
var tab = this.outputConnection ? Blockly.BlockSvg.TAB_WIDTH : 0;
var blockBounds = this.getHeightWidth();
var top = blockXY.y;
@@ -1513,7 +1513,7 @@ Blockly.BlockSvg.prototype.appendInput_ = function(type, name) {
*/
Blockly.BlockSvg.prototype.waitToTrackConnections = function() {
this.callTrackConnections_ = false;
var children = this.getChildren();
var children = this.getChildren(false);
for (var i = 0, child; child = children[i]; i++) {
child.waitToTrackConnections();
}

View File

@@ -269,7 +269,8 @@ Blockly.onKeyDown = function(e) {
if (deleteBlock && !Blockly.selected.workspace.isFlyout) {
Blockly.Events.setGroup(true);
Blockly.hideChaff();
Blockly.selected.dispose(/* heal */ true, true);
var selected = /** @type {!Blockly.BlockSvg} */ (Blockly.selected);
selected.dispose(/* heal */ true, true);
Blockly.Events.setGroup(false);
}
};

View File

@@ -121,7 +121,7 @@ Blockly.Connection.prototype.connect_ = function(childConnection) {
if (orphanBlock.isShadow()) {
// Save the shadow block so that field values are preserved.
shadowDom = Blockly.Xml.blockToDom(orphanBlock);
orphanBlock.dispose();
orphanBlock.dispose(false);
orphanBlock = null;
} else if (parentConnection.type == Blockly.INPUT_VALUE) {
// Value connections.
@@ -212,7 +212,7 @@ Blockly.Connection.prototype.dispose = function() {
var targetBlock = this.targetBlock();
if (targetBlock.isShadow()) {
// Destroy the attached shadow block & its children.
targetBlock.dispose();
targetBlock.dispose(false);
} else {
// Disconnect the attached normal block.
targetBlock.unplug();

View File

@@ -431,10 +431,12 @@ Blockly.Generator.prototype.init = function(_workspace) {
* value blocks.
* @param {!Blockly.Block} _block The current block.
* @param {string} code The code created for this block.
* @param {boolean=} _opt_thisOnly True to generate code for only this
* statement.
* @return {string} Code with comments and subsequent blocks added.
* @private
* @protected
*/
Blockly.Generator.prototype.scrub_ = function(_block, code) {
Blockly.Generator.prototype.scrub_ = function(_block, code, _opt_thisOnly) {
// Optionally override
return code;
};

View File

@@ -247,7 +247,7 @@ Blockly.InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlo
Blockly.Events.disable();
try {
var result = this.workspace_.newBlock(imType);
result.setInsertionMarker(true, sourceBlock.width);
result.setInsertionMarker(true);
result.setCollapsed(sourceBlock.isCollapsed());
if (sourceBlock.mutationToDom) {
var oldMutationDom = sourceBlock.mutationToDom();

View File

@@ -276,7 +276,7 @@ Blockly.VariableMap.prototype.deleteVariableInternal_ = function(variable,
}
try {
for (var i = 0; i < uses.length; i++) {
uses[i].dispose(true, false);
uses[i].dispose(true);
}
this.deleteVariable(variable);
} finally {

View File

@@ -479,10 +479,10 @@ Blockly.Workspace.prototype.clear = function() {
Blockly.Events.setGroup(true);
}
while (this.topBlocks_.length) {
this.topBlocks_[0].dispose();
this.topBlocks_[0].dispose(false);
}
while (this.topComments_.length) {
this.topComments_[this.topComments_.length - 1].dispose();
this.topComments_[this.topComments_.length - 1].dispose(false);
}
if (!existingGroup) {
Blockly.Events.setGroup(false);
@@ -665,7 +665,7 @@ Blockly.Workspace.prototype.remainingCapacityOfType = function(type) {
return Infinity;
}
return (this.options.maxInstances[type] || Infinity) -
this.getBlocksByType(type).length;
this.getBlocksByType(type, false).length;
};
/**