Commit 3f4ce70d authored by Péter Szilágyi's avatar Péter Szilágyi

jsre: fix wrong separator comma placing due to non consistent field orders

parent 11f65cf8
...@@ -26,19 +26,19 @@ function pp(object, indent) { ...@@ -26,19 +26,19 @@ function pp(object, indent) {
} else if(typeof(object) === "object") { } else if(typeof(object) === "object") {
str += "{\n"; str += "{\n";
indent += " "; indent += " ";
var last = getFields(object).pop()
getFields(object).forEach(function (k) { var fields = getFields(object);
str += indent + k + ": "; var last = fields[fields.length - 1];
fields.forEach(function (key) {
str += indent + key + ": ";
try { try {
str += pp(object[k], indent); str += pp(object[key], indent);
} catch (e) { } catch (e) {
str += pp(e, indent); str += pp(e, indent);
} }
if(key !== last) {
if(k !== last) {
str += ","; str += ",";
} }
str += "\n"; str += "\n";
}); });
str += indent.substr(2, indent.length) + "}"; str += indent.substr(2, indent.length) + "}";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment