mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Check against healing child shadow blocks. Fix #2227 (PR#2271)
Merge from AnmAtAnm/fix2227-heal-shadows
This commit is contained in:
@@ -379,7 +379,9 @@ Blockly.Block.prototype.unplugFromRow_ = function(opt_healStack) {
|
||||
}
|
||||
|
||||
var thisConnection = this.getOnlyValueConnection_();
|
||||
if (!thisConnection || !thisConnection.isConnected()) {
|
||||
if (!thisConnection ||
|
||||
!thisConnection.isConnected() ||
|
||||
thisConnection.targetBlock().isShadow()) {
|
||||
// Too many or too few possible connections on this block, or there's
|
||||
// nothing on the other side of this connection.
|
||||
return;
|
||||
@@ -430,7 +432,7 @@ Blockly.Block.prototype.unplugFromStack_ = function(opt_healStack) {
|
||||
this.previousConnection.disconnect();
|
||||
}
|
||||
var nextBlock = this.getNextBlock();
|
||||
if (opt_healStack && nextBlock) {
|
||||
if (opt_healStack && nextBlock && !nextBlock.isShadow()) {
|
||||
// Disconnect the next statement.
|
||||
var nextTarget = this.nextConnection.targetConnection;
|
||||
nextTarget.disconnect();
|
||||
|
||||
@@ -1123,6 +1123,22 @@ h1 {
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Shadow value</field>
|
||||
</shadow>
|
||||
</value>
|
||||
<next>
|
||||
<shadow type="text_print">
|
||||
<value name="TEXT">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Shadow statement</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</shadow>
|
||||
</next>
|
||||
</block>
|
||||
<label text="Multiple Variable Refs"></label>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
|
||||
Reference in New Issue
Block a user