From c862a13a38057264a5b526a6ee399e2bddfc1e2d Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 9 Aug 2019 09:20:14 -0700 Subject: [PATCH] Cleaned up BlockBase and CommentBase toJson and fromJson calls. --- core/block_events.js | 2 +- core/ws_comment_events.js | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/core/block_events.js b/core/block_events.js index b57fe3ee3..1d201063f 100644 --- a/core/block_events.js +++ b/core/block_events.js @@ -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']; }; diff --git a/core/ws_comment_events.js b/core/ws_comment_events.js index 70ca6d0cd..ce8f2a847 100644 --- a/core/ws_comment_events.js +++ b/core/ws_comment_events.js @@ -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']; }; /**