Explorar el Código

Added double quotes around keys in JSON encoded strings to conform with JSON format.

Robert Larsen hace 14 años
padre
commit
502d313351
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      core/convenience.js

+ 1 - 1
core/convenience.js

@@ -122,7 +122,7 @@
         if (!i.match(/^[a-z0-9]+$/i)) {
           throw new sjcl.exception.invalid("json encode: invalid property name");
         }
-        out += comma + i + ':';
+        out += comma + '"' + i + '"' + ':';
         comma = ',';
         
         switch (typeof obj[i]) {