瀏覽代碼

Merge pull request #40 from RobertLarsen/master

Fixed JSON format issue
bitwiseshiftleft 14 年之前
父節點
當前提交
61228e7c23
共有 1 個文件被更改,包括 1 次插入1 次删除
  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]) {