mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Add a getter; stop accessing private field sourceBlock_ from outside of a connection.
This commit is contained in:
@@ -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_();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user