Review updates

This commit is contained in:
Neil Fraser
2021-07-01 10:48:16 -07:00
committed by Neil Fraser
parent 02fd8cf7a4
commit 2c6d044c40
3 changed files with 4 additions and 11 deletions

View File

@@ -55,6 +55,7 @@ goog.requireType('Blockly.WorkspaceSvg');
* the individual field's documentation for a list of properties this
* parameter supports.
* @constructor
* @abstract
* @implements {Blockly.IASTNodeLocationSvg}
* @implements {Blockly.IASTNodeLocationWithBlock}
* @implements {Blockly.IKeyboardAccessible}
@@ -154,14 +155,6 @@ Blockly.Field = function(value, opt_validator, opt_config) {
opt_validator && this.setValidator(opt_validator);
};
/**
* Construct a Field from a JSON arg object.
* @param {!Object} _options A JSON object with options.
*/
Blockly.Field.fromJson = function(_options) {
throw Error("Field subclass doesn't define fromJson");
};
/**
* The default value for this field.
* @type {*}

View File

@@ -151,7 +151,7 @@ Blockly.FieldDropdown.ImageProperties;
Blockly.FieldDropdown.fromJson = function(options) {
// `this` might be a subclass of FieldDropdown if that class doesn't override
// the static fromJson method.
return new Blockly.FieldDropdown(options['options'], undefined, options);
return new this(options['options'], undefined, options);
};
/**

View File

@@ -89,8 +89,8 @@ Blockly.FieldMultilineInput.prototype.configure_ = function(config) {
*/
Blockly.FieldMultilineInput.fromJson = function(options) {
var text = Blockly.utils.replaceMessageReferences(options['text']);
// `this` might be a subclass of FieldLabel if that class doesn't override
// the static fromJson method.
// `this` might be a subclass of FieldMultilineInput if that class doesn't
// override the static fromJson method.
return new this(text, undefined, options);
};