a:7:{s:9:"#provides";s:4:"dojo";s:9:"#resource";s:13:"_base/json.js";s:13:"dojo.fromJson";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"json";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:133:"a string literal of a JSON item, for instance: `'{ "foo": [ "bar", 1, { "baz": "thud" } ] }'`";}}s:6:"source";s:41:" return eval("(" + json + ")"); // Object";s:7:"summary";s:104:"Parses a [JSON](http://json.org) string to return a JavaScript object. Throws for invalid JSON strings.";s:7:"returns";s:6:"Object";}s:18:"dojo._escapeString";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"str";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:190:" return ('"' + str.replace(/(["\\])/g, '\\$1') + '"'). replace(/[\f]/g, "\\f").replace(/[\b]/g, "\\b").replace(/[\n]/g, "\\n"). replace(/[\t]/g, "\\t").replace(/[\r]/g, "\\r"); // string";s:7:"summary";s:140:"Adds escape sequences for non-visual characters, double quote and backslash and surrounds with double quotes to form a valid string literal.";s:7:"private";b:1;}s:11:"dojo.toJson";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:2:"it";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:221:"an object to be serialized. Objects may define their own serialization via a special "__json__" or "json" function property. If a specialized serializer has been defined, it will be used as a fallback.";}s:11:"prettyPrint";a:3:{s:8:"optional";b:1;s:4:"type";s:7:"Boolean";s:7:"summary";s:230:"if true, we indent objects and arrays to make the output prettier. The variable dojo.toJsonIndentStr is used as the indent string -- to use something other than the default (tab), change that variable before calling dojo.toJson().";}s:10:"_indentStr";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"String";s:7:"summary";s:70:"private variable for recursive calls when pretty printing, do not use.";}}s:6:"source";s:2347:" if(it === undefined){ return "undefined"; } var objtype = typeof it; if(objtype == "number" || objtype == "boolean"){ return it + ""; } if(it === null){ return "null"; } if(dojo.isString(it)){ return dojo._escapeString(it); } // recurse var recurse = arguments.callee; // short-circuit for objects that support "json" serialization // if they return "self" then just pass-through... var newObj; _indentStr = _indentStr || ""; var nextIndent = prettyPrint ? _indentStr + dojo.toJsonIndentStr : ""; var tf = it.__json__||it.json; if(dojo.isFunction(tf)){ newObj = tf.call(it); if(it !== newObj){ return recurse(newObj, prettyPrint, nextIndent); } } if(it.nodeType && it.cloneNode){ // isNode // we can't seriailize DOM nodes as regular objects because they have cycles // DOM nodes could be serialized with something like outerHTML, but // that can be provided by users in the form of .json or .__json__ function. throw new Error("Can't serialize DOM nodes"); } var sep = prettyPrint ? " " : ""; var newLine = prettyPrint ? "\n" : ""; // array if(dojo.isArray(it)){ var res = dojo.map(it, function(obj){ var val = recurse(obj, prettyPrint, nextIndent); if(typeof val != "string"){ val = "undefined"; } return newLine + nextIndent + val; }); return "[" + res.join("," + sep) + newLine + _indentStr + "]"; } /* // look in the registry try { window.o = it; newObj = dojo.json.jsonRegistry.match(it); return recurse(newObj, prettyPrint, nextIndent); }catch(e){ // console.log(e); } // it's a function with no adapter, skip it */ if(objtype == "function"){ return null; // null } // generic object code path var output = [], key; for(key in it){ var keyStr, val; if(typeof key == "number"){ keyStr = '"' + key + '"'; }else if(typeof key == "string"){ keyStr = dojo._escapeString(key); }else{ // skip non-string or number keys continue; } val = recurse(it[key], prettyPrint, nextIndent); if(typeof val != "string"){ // skip non-serializable values continue; } // FIXME: use += on Moz!! // MOW NOTE: using += is a pain because you have to account for the dangling comma... output.push(newLine + nextIndent + keyStr + ":" + sep + val); } return "{" + output.join("," + sep) + newLine + _indentStr + "}"; // String";s:7:"summary";s:61:"Returns a [JSON](http://json.org) serialization of an object.";s:11:"description";s:132:"Returns a [JSON](http://json.org) serialization of an object. Note that this doesn't check for infinite recursion, so don't do that!";s:7:"returns";s:11:"null|String";}s:20:"dojo.toJsonIndentStr";a:1:{s:7:"summary";s:0:"";}s:4:"dojo";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}