Changeset 13188

Show
Ignore:
Timestamp:
03/24/08 20:06:41 (8 months ago)
Author:
peller
Message:

Clean up docs. Refs #5962 !strict

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/_base/json.js

    r12247 r13188  
    33dojo.fromJson = function(/*String*/ json){ 
    44        // summary: 
    5         //              evaluates the passed string-form of a JSON object 
     5        //              Parses a [JSON](http://json.org) string to return a JavaScript object. 
    66        // json:  
    77        //              a string literal of a JSON item, for instance: 
    8         //                      '{ "foo": [ "bar", 1, { "baz": "thud" } ] }' 
    9         // return: 
    10         //              An object, the result of the evaluation 
     8        //                      `'{ "foo": [ "bar", 1, { "baz": "thud" } ] }'` 
    119 
    12         return eval("(" + json + ")"); 
     10        return eval("(" + json + ")"); // Object 
    1311} 
    1412 
     
    2624dojo.toJson = function(/*Object*/ it, /*Boolean?*/ prettyPrint, /*String?*/ _indentStr){ 
    2725        // summary: 
    28         //              Create a JSON serialization of an object.  
     26        //              Returns a [JSON](http://json.org) serialization of an object. 
     27        // 
     28        // description: 
     29        //              Returns a [JSON](http://json.org) serialization of an object. 
    2930        //              Note that this doesn't check for infinite recursion, so don't do that! 
    3031        // 
     
    4344        // _indentStr: 
    4445        //              private variable for recursive calls when pretty printing, do not use. 
    45         //               
    46         // return: 
    47         //              a String representing the serialized version of the passed object. 
    4846 
    4947        if(it === undefined){ 
     
    109107        */ 
    110108        if(objtype == "function"){ 
    111                 return null; 
     109                return null; // null 
    112110        } 
    113111        // generic object code path 
     
    132130                output.push(newLine + nextIndent + keyStr + ":" + sep + val); 
    133131        } 
    134         return "{" + output.join("," + sep) + newLine + _indentStr + "}"; 
     132        return "{" + output.join("," + sep) + newLine + _indentStr + "}"; // String 
    135133}