mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Make tests pass
This commit is contained in:
parent
4f28d1fb61
commit
fd67f358e8
2 changed files with 24 additions and 12 deletions
|
@ -324,6 +324,9 @@ Blockly.Connection.prototype.isConnected = function() {
|
|||
* @private
|
||||
*/
|
||||
Blockly.Connection.prototype.canConnectWithReason_ = function(target) {
|
||||
if (!target) {
|
||||
return Blockly.Connection.REASON_TARGET_NULL;
|
||||
}
|
||||
if (this.isSuperior()) {
|
||||
var blockA = this.sourceBlock_;
|
||||
var blockB = target.getSourceBlock();
|
||||
|
@ -331,9 +334,8 @@ Blockly.Connection.prototype.canConnectWithReason_ = function(target) {
|
|||
var blockB = this.sourceBlock_;
|
||||
var blockA = target.getSourceBlock();
|
||||
}
|
||||
if (!target) {
|
||||
return Blockly.Connection.REASON_TARGET_NULL;
|
||||
} else if (blockA && blockA == blockB) {
|
||||
|
||||
if (blockA && blockA == blockB) {
|
||||
return Blockly.Connection.REASON_SELF_CONNECTION;
|
||||
} else if (target.type != Blockly.OPPOSITE_TYPE[this.type]) {
|
||||
return Blockly.Connection.REASON_WRONG_TYPE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue