mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Allow inheriting of fromJson in fields
This commit is contained in:
@@ -135,7 +135,9 @@ Blockly.FieldAngle.prototype.DEFAULT_VALUE = 0;
|
||||
* @nocollapse
|
||||
*/
|
||||
Blockly.FieldAngle.fromJson = function(options) {
|
||||
return new Blockly.FieldAngle(options['angle'], undefined, options);
|
||||
// `this` might be a subclass of FieldAngle if that class doesn't override
|
||||
// the static fromJson method.
|
||||
return new this(options['angle'], undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user