Add a console warning for defining a toolbox using JSON (#3937)

This commit is contained in:
alschmiedt
2020-06-10 11:11:28 -07:00
committed by GitHub
parent 1349017c8a
commit b1211f6dd2

View File

@@ -99,6 +99,8 @@ Blockly.utils.toolbox.convertToolboxToJSON = function(toolboxDef) {
}
// If it is an array of JSON, then it is already in the correct format.
if (Array.isArray(toolboxDef) && toolboxDef.length && !(toolboxDef[0].nodeType)) {
console.warn('Due to some performance issues, defining a toolbox using JSON is not' +
' ready yet. Please define your toolbox using xml.');
return /** @type {!Array.<Blockly.utils.toolbox.Toolbox>} */ (toolboxDef);
}