Add a getter; stop accessing private field sourceBlock_ from outside of a connection.

This commit is contained in:
rachel-fenichel
2016-03-15 16:03:49 -07:00
parent 06ff90bcaf
commit 2c70f7ec26
7 changed files with 49 additions and 29 deletions

View File

@@ -471,7 +471,7 @@ Blockly.Blocks['logic_ternary'] = {
if (block && !block.outputConnection.checkType_(parentConnection)) {
if (parentConnection === this.prevParentConnection_) {
this.unplug();
parentConnection.sourceBlock_.bumpNeighbours_();
parentConnection.getSourceBlock().bumpNeighbours_();
} else {
block.unplug();
block.bumpNeighbours_();

View File

@@ -221,7 +221,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
if (stackConnection.targetConnection ||
!this.statementConnection_ ||
this.statementConnection_.targetConnection ||
this.statementConnection_.sourceBlock_.workspace !=
this.statementConnection_.getSourceBlock().workspace !=
this.workspace) {
// Block no longer exists or has been attached elsewhere.
this.statementConnection_ = null;
@@ -552,7 +552,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
if (quarkName in this.quarkConnections_) {
var connection = this.quarkConnections_[quarkName];
if (!connection || connection.targetConnection ||
connection.sourceBlock_.workspace != this.workspace) {
connection.getSourceBlock().workspace != this.workspace) {
// Block no longer exists or has been attached elsewhere.
delete this.quarkConnections_[quarkName];
} else {