JS Doc and private

This commit is contained in:
Rachel Fenichel
2016-05-10 15:39:37 -07:00
parent ae745dac80
commit e28db7bc4e
4 changed files with 72 additions and 25 deletions

View File

@@ -746,7 +746,8 @@ Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) {
if (!this.previousConnection) {
goog.asserts.assert(!this.outputConnection,
'Remove output connection prior to adding previous connection.');
this.previousConnection = this.makeConnection(Blockly.PREVIOUS_STATEMENT);
this.previousConnection =
this.makeConnection_(Blockly.PREVIOUS_STATEMENT);
}
this.previousConnection.setCheck(opt_check);
} else {
@@ -771,7 +772,7 @@ Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) {
opt_check = null;
}
if (!this.nextConnection) {
this.nextConnection = this.makeConnection(Blockly.NEXT_STATEMENT);
this.nextConnection = this.makeConnection_(Blockly.NEXT_STATEMENT);
}
this.nextConnection.setCheck(opt_check);
} else {
@@ -799,7 +800,7 @@ Blockly.Block.prototype.setOutput = function(newBoolean, opt_check) {
if (!this.outputConnection) {
goog.asserts.assert(!this.previousConnection,
'Remove previous connection prior to adding output connection.');
this.outputConnection = this.makeConnection(Blockly.OUTPUT_VALUE);
this.outputConnection = this.makeConnection_(Blockly.OUTPUT_VALUE);
}
this.outputConnection.setCheck(opt_check);
} else {
@@ -1156,7 +1157,7 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) {
Blockly.Block.prototype.appendInput_ = function(type, name) {
var connection = null;
if (type == Blockly.INPUT_VALUE || type == Blockly.NEXT_STATEMENT) {
connection = this.makeConnection(type);
connection = this.makeConnection_(type);
}
var input = new Blockly.Input(type, name, this, connection);
// Append input to list.
@@ -1334,6 +1335,12 @@ Blockly.Block.prototype.moveBy = function(dx, dy) {
Blockly.Events.fire(event);
};
Blockly.Block.prototype.makeConnection = function(type) {
/**
* Create a connection of the specified type.
* @param {number} type The type of the connection to create.
* @return {!Blockly.Connection} A new connection of the specified type.
* @private
*/
Blockly.Block.prototype.makeConnection_ = function(type) {
return new Blockly.Connection(this, type);
};