Fixed bug and added compatibility for converting RunningScript offline dataMap to version v0.43.1

This commit is contained in:
danielyxie
2019-02-12 01:14:38 -08:00
parent 1d0515a957
commit 08417f250e
7 changed files with 26 additions and 10 deletions
+9 -1
View File
@@ -15,7 +15,15 @@ function Reviver(key, value) {
if (typeof value === "object" &&
typeof value.ctor === "string" &&
typeof value.data !== "undefined") {
// Compatibility for version v0.43.1
// TODO Remove this eventually
if (value.ctor === "AllServersMap") {
console.log('Converting AllServersMap for v0.43.1');
return value.data;
}
ctor = Reviver.constructors[value.ctor] || window[value.ctor];
if (typeof ctor === "function" &&
typeof ctor.fromJSON === "function") {
@@ -45,7 +53,7 @@ function Generic_toJSON(ctorName, obj, keys) {
}
data = {};
for (index = 0; index < keys.length; ++index) {
for (let index = 0; index < keys.length; ++index) {
key = keys[index];
data[key] = obj[key];
}