From 9ca00656ad763e7a134e790400a60dc46005b95f Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Sun, 5 Jun 2016 16:58:27 -0700 Subject: [PATCH] Properly deal with shadow statement blocks in stacks. --- core/connection.js | 5 +++-- tests/multi_playground.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/connection.js b/core/connection.js index 1728576a6..d245c3548 100644 --- a/core/connection.js +++ b/core/connection.js @@ -180,8 +180,9 @@ Blockly.Connection.prototype.connect_ = function(childConnection) { // block. Since this block may be a stack, walk down to the end. var newBlock = childBlock; while (newBlock.nextConnection) { - if (newBlock.nextConnection.isConnected()) { - newBlock = newBlock.getNextBlock(); + var nextBlock = newBlock.getNextBlock(); + if (nextBlock && !nextBlock.isShadow()) { + newBlock = nextBlock; } else { if (orphanBlock.previousConnection.checkType_( newBlock.nextConnection)) { diff --git a/tests/multi_playground.html b/tests/multi_playground.html index c25d7a543..f541d6f6b 100644 --- a/tests/multi_playground.html +++ b/tests/multi_playground.html @@ -161,7 +161,7 @@ h1 {