mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
disallow variables on shadow blocks
This commit is contained in:
@@ -535,6 +535,9 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) {
|
||||
goog.asserts.assert(child.isShadow(),
|
||||
'Shadow block not allowed non-shadow child.');
|
||||
}
|
||||
// Ensure this block doesn't have any variable inputs.
|
||||
goog.asserts.assert(block.getVars().length == 0,
|
||||
'Shadow blocks cannot have variable fields.');
|
||||
block.setShadow(true);
|
||||
}
|
||||
return block;
|
||||
|
||||
Reference in New Issue
Block a user