mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Do not allow shadow blocks to have non-shadow children.
This commit is contained in:
@@ -521,6 +521,12 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) {
|
||||
block.setCollapsed(collapsed == 'true');
|
||||
}
|
||||
if (xmlBlock.nodeName.toLowerCase() == 'shadow') {
|
||||
// Ensure all children are also shadows.
|
||||
var children = block.getChildren();
|
||||
for (var i = 0, child; child = children[i]; i++) {
|
||||
goog.asserts.assert(child.isShadow(),
|
||||
'Shadow block not allowed non-shadow child.');
|
||||
}
|
||||
block.setShadow(true);
|
||||
}
|
||||
// Give the block a chance to clean up any initial inputs.
|
||||
|
||||
Reference in New Issue
Block a user