Clean up comment serialization, add tests for new and old serialization (old is still valid, just more verbose).

This commit is contained in:
Karishma Chadha 2018-06-15 14:57:49 -04:00
parent 29b79878bc
commit f3d49f75c8
3 changed files with 77 additions and 2 deletions
src/serialization

View file

@ -395,7 +395,6 @@ const serializeComments = function (comments) {
const comment = comments[commentId];
const serializedComment = Object.create(null);
serializedComment.id = comment.id;
serializedComment.blockId = comment.blockId;
serializedComment.x = comment.x;
serializedComment.y = comment.y;
@ -864,7 +863,7 @@ const parseScratchObject = function (object, runtime, extensions, zip) {
for (const commentId in object.comments) {
const comment = object.comments[commentId];
const newComment = new Comment(
comment.id,
commentId,
comment.text,
comment.x,
comment.y,