Fix #1499 and add some validation

This commit is contained in:
Rachel Fenichel
2018-01-17 16:50:14 -08:00
parent 3f61f71f35
commit 7314bdfb3a
3 changed files with 82 additions and 9 deletions

View File

@@ -1340,7 +1340,8 @@ Blockly.Block.newFieldTextInputFromJson_ = function(options) {
Blockly.Block.newFieldVariableFromJson_ = function(options) {
var varname = Blockly.utils.replaceMessageReferences(options['variable']);
var variableTypes = options['variableTypes'];
return new Blockly.FieldVariable(varname, null, variableTypes);
var defaultType = options['defaultType'];
return new Blockly.FieldVariable(varname, null, variableTypes, defaultType);
};