Fix the rest of serialization problems and make test-serialize.ts compare the original and resulting JSON.

This commit is contained in:
László Monda
2016-04-01 23:08:37 +02:00
parent 4d5f8161e1
commit c8498eab5e
4 changed files with 12 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ class DualRoleKeystrokeAction extends KeyAction implements Serializable<DualRole
fromJsObject(jsObject: any): DualRoleKeystrokeAction {
this.assertKeyActionType(jsObject, KeyActionType.DualRoleKeystrokeAction, 'DualRoleKeystrokeAction');
this.scancode = jsObject.scancode;
this.longPressAction = jsObject.longPressAction;
this.longPressAction = LongPressAction[<string>jsObject.longPressAction];
return this;
}
@@ -51,7 +51,7 @@ class DualRoleKeystrokeAction extends KeyAction implements Serializable<DualRole
return {
keyActionType: KeyActionType.DualRoleKeystrokeAction,
scancode: this.scancode,
longPressAction: KeyActionId[this.longPressAction]
longPressAction: LongPressAction[this.longPressAction]
};
}

View File

@@ -34,7 +34,6 @@ class MouseAction extends KeyAction implements Serializable<MouseAction> {
fromJsObject(jsObject: any): MouseAction {
this.assertKeyActionType(jsObject, KeyActionType.MouseAction, 'MouseAction');
console.log(jsObject.mouseAction)
this.mouseAction = MouseActionParam[<string>jsObject.mouseAction];
return this;
}

View File

@@ -12,7 +12,7 @@ class NoneAction extends KeyAction implements Serializable<NoneAction> {
toJsObject(): any {
return {
keyActionType: KeyActionId.NoneAction
keyActionType: KeyActionType.NoneAction
};
}