Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up BlockBase and CommentBase toJson and fromJson Calls #2792

Merged
merged 2 commits into from Aug 14, 2019

Conversation

BeksOmega
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

N/A

Proposed Changes

Makes it so that the BlockBase and CommentBase events properly call the base toJson and fromJson functions.

Reason for Changes

Code simplification.

Test Coverage

These are the base functions:

Blockly.Events.Abstract.prototype.toJson = function() {
  var json = {
    'type': this.type
  };
  if (this.group) {
    json['group'] = this.group;
  }
  return json;
};

Blockly.Events.Abstract.prototype.fromJson = function(json) {
  this.group = json['group'];
};

Also link.

As you can see this means we achieve the same functionality as before.

If there are other tests you'd like me to do I'd be glad to =)

Tested on:

Documentation

Nope!

Additional Information

@rachel-fenichel since I'm touching workspace comments.

Copy link
Collaborator

@rachel-fenichel rachel-fenichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One problem and then it's good.

@@ -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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: COmment -> Comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@rachel-fenichel rachel-fenichel merged commit 863f7f4 into google:develop Aug 14, 2019
@BeksOmega BeksOmega deleted the fixes/EventInheritance branch August 18, 2019 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants