From 8c1c2ee76a5748a1cbb1814aed845c52632a0a5a Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 1 Nov 2008 19:29:25 +0000 Subject: [PATCH] Dont sort constants in objectToString (theyre better ordered by value than key) --- content/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/util.js b/content/util.js index 2c106b0e..fafb83e6 100644 --- a/content/util.js +++ b/content/util.js @@ -329,6 +329,8 @@ const util = { //{{{ key = {i}; if (!isNaN(i)) i = parseInt(i); + else if (/^[A-Z_]+$/.test(i)) + i = ""; keys.push([i, <>{key}{noVal ? "" : <>:{value}}
]); } } @@ -338,7 +340,7 @@ const util = { //{{{ { if (!isNaN(a[0]) && !isNaN(b[0])) return a[0] - b[0]; - return String.localeCompare(a, b); + return String.localeCompare(a[0], b[0]); } string += template.map(keys.sort(compare), function (f) f[1]); return color ? string : [s for each (s in string)].join("");