1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Index: /Users/jan/webdev/moodev/mootools/trunk/Remote/Json.js
===================================================================
--- /Users/jan/webdev/moodev/mootools/trunk/Remote/Json.js  (revision 696)
+++ /Users/jan/webdev/moodev/mootools/trunk/Remote/Json.js  (working copy)
@@ -30,6 +30,7 @@
    */
 
    toString: function(obj){
+       if(obj.toJSON) return obj.toJSON();
        switch($type(obj)){
            case 'string':
                return '"' + obj.replace(/[\x00-\x1f\\"]/g, Json.$replaceChars) + '"';
@@ -63,7 +64,7 @@
        converts a json string to an javascript Object.
 
    Arguments:
-       str - the string to evaluate. if its not a string, it returns false.
+       str - the string to evaluate. If its not a string, it returns null.
        secure - optionally, performs syntax check on json string. Defaults to false.
 
    Credits: