fix: shadow blocks with variable fields are not allowed to be deserialized from XML (#7802)

This commit is contained in:
Ebrahim Haji
2024-01-23 10:51:24 -06:00
committed by GitHub
parent 767b452aa9
commit ff45a36835

View File

@@ -995,10 +995,7 @@ function domToBlockHeadless(
throw TypeError('Shadow block not allowed non-shadow child.');
}
}
// Ensure this block doesn't have any variable inputs.
if (block.getVarModels().length) {
throw TypeError('Shadow blocks cannot have variable references.');
}
block.setShadow(true);
}
return block;