Cleaned up BlockBase and CommentBase toJson and fromJson calls.

This commit is contained in:
Beka Westberg
2019-08-09 09:20:14 -07:00
parent f3aca51ba9
commit c862a13a38
2 changed files with 3 additions and 8 deletions

View File

@@ -73,7 +73,7 @@ Blockly.Events.BlockBase.prototype.toJson = function() {
* @param {!Object} json JSON representation.
*/
Blockly.Events.BlockBase.prototype.fromJson = function(json) {
Blockly.Events.BlockBase.superClass_.toJson.call(this);
Blockly.Events.BlockBase.superClass_.fromJson.call(this, json);
this.blockId = json['blockId'];
};

View File

@@ -78,12 +78,7 @@ goog.inherits(Blockly.Events.CommentBase, Blockly.Events.Abstract);
* @return {!Object} JSON representation.
*/
Blockly.Events.CommentBase.prototype.toJson = function() {
var json = {
'type': this.type
};
if (this.group) {
json['group'] = this.group;
}
var json = Blockly.Events.CommentBase.superClass_.toJson.call(this);
if (this.commentId) {
json['commentId'] = this.commentId;
}
@@ -95,8 +90,8 @@ Blockly.Events.CommentBase.prototype.toJson = function() {
* @param {!Object} json JSON representation.
*/
Blockly.Events.CommentBase.prototype.fromJson = function(json) {
Blockly.Events.COmmentBase.superClass_.fromJson.call(this, json);
this.commentId = json['commentId'];
this.group = json['group'];
};
/**