source: cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/api/json-stringify.js.html @ 5259

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/api/json-stringify.js.html@5259
Revision 5259, 27.9 KB checked in by domlowe, 11 years ago (diff)

adding yui javascript

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4        <title>API: json   json-stringify.js  (YUI Library)</title>
5        <link rel="stylesheet" type="text/css" href="assets/api.css">
6    <script type="text/javascript" src="assets/api-js"></script>
7    <script type="text/javascript" src="assets/ac-js"></script>
8</head>
9
10<body id="yahoo-com">
11
12<div id="doc3" class="yui-t2">
13
14        <div id="hd">
15        <a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
16        <h3>json&nbsp; <span class="subtitle">3.0.0pr1</span></h3>
17        <p>
18        <a href="./index.html">Yahoo! UI Library</a> 
19            &gt; <a href="./module_json.html">json</a>
20               
21                 &gt; json-stringify.js (source view)
22            </p>
23
24
25        </div>
26
27        <div id="bd">
28                <div id="yui-main">
29                        <div class="yui-b">
30            <form name="yui-classopts-form">
31    <span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> <label for="showprivate">Show Private</label></span>
32    <span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> <label for="showprotected">Show Protected</label></span>
33    <span id="classopts"><input type="checkbox" name="showdeprecated" id="showdeprecated" /> <label for="showdeprecated">Show Deprecated</label></span>
34            </form>
35
36                    <div id="srcout">
37                        <style>
38                            #doc3 #classopts { display:none; }
39                        </style>
40<div class="highlight" ><pre><span class="c">/**</span>
41<span class="c"> * Provides Y.JSON.stringify method for converting objects to JSON strings.</span>
42<span class="c"> * @module json</span>
43<span class="c"> * @submodule json-stringify</span>
44<span class="c"> * @for JSON</span>
45<span class="c"> * @static</span>
46<span class="c"> */</span>
47<span class="k">var</span> <span class="nx">isA</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">;</span>
48
49<span class="nx">Y</span><span class="o">.</span><span class="nx">JSON</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">JSON</span> <span class="o">||</span> <span class="o">{};</span>
50
51<span class="nx">Y</span><span class="o">.</span><span class="nx">mix</span><span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">JSON</span><span class="o">,{</span>
52    <span class="c">/**</span>
53<span class="c">     * Regex used to capture characters that need escaping before enclosing</span>
54<span class="c">     * their containing string in quotes.</span>
55<span class="c">     * @property _SPECIAL_CHARS</span>
56<span class="c">     * @type {RegExp}</span>
57<span class="c">     * @private</span>
58<span class="c">     */</span>
59    <span class="nx">_SPECIAL_CHARS</span> <span class="o">:</span> <span class="sr">/[\\\&quot;\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g</span><span class="o">,</span>
60
61    <span class="c">/**</span>
62<span class="c">     * Character substitution map for common escapes and special characters.</span>
63<span class="c">     * @property _CHARS</span>
64<span class="c">     * @type {Object}</span>
65<span class="c">     * @static</span>
66<span class="c">     * @private</span>
67<span class="c">     */</span>
68    <span class="nx">_CHARS</span> <span class="o">:</span> <span class="o">{</span>
69        <span class="s1">&#39;\b&#39;</span><span class="o">:</span> <span class="s1">&#39;\\b&#39;</span><span class="o">,</span>
70        <span class="s1">&#39;\t&#39;</span><span class="o">:</span> <span class="s1">&#39;\\t&#39;</span><span class="o">,</span>
71        <span class="s1">&#39;\n&#39;</span><span class="o">:</span> <span class="s1">&#39;\\n&#39;</span><span class="o">,</span>
72        <span class="s1">&#39;\f&#39;</span><span class="o">:</span> <span class="s1">&#39;\\f&#39;</span><span class="o">,</span>
73        <span class="s1">&#39;\r&#39;</span><span class="o">:</span> <span class="s1">&#39;\\r&#39;</span><span class="o">,</span>
74        <span class="s1">&#39;&quot;&#39;</span> <span class="o">:</span> <span class="s1">&#39;\\&quot;&#39;</span><span class="o">,</span>
75        <span class="s1">&#39;\\&#39;</span><span class="o">:</span> <span class="s1">&#39;\\\\&#39;</span>
76    <span class="o">},</span>
77
78    <span class="c">/**</span>
79<span class="c">     * Serializes a Date instance as a UTC date string.  Used internally by</span>
80<span class="c">     * stringify.  Override this method if you need Dates serialized in a</span>
81<span class="c">     * different format.</span>
82<span class="c">     * @method dateToString</span>
83<span class="c">     * @param d {Date} The Date to serialize</span>
84<span class="c">     * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ</span>
85<span class="c">     * @static</span>
86<span class="c">     */</span>
87    <span class="nx">dateToString</span> <span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">d</span><span class="o">)</span> <span class="o">{</span>
88        <span class="k">function</span> <span class="nx">_zeroPad</span><span class="o">(</span><span class="nx">v</span><span class="o">)</span> <span class="o">{</span>
89            <span class="k">return</span> <span class="nx">v</span> <span class="o">&lt;</span> <span class="m">10</span> <span class="o">?</span> <span class="s1">&#39;0&#39;</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">:</span> <span class="nx">v</span><span class="o">;</span>
90        <span class="o">}</span>
91
92        <span class="k">return</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">+</span> <span class="nx">d</span><span class="o">.</span><span class="nx">getUTCFullYear</span><span class="o">()</span>   <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span>
93            <span class="nx">_zeroPad</span><span class="o">(</span><span class="nx">d</span><span class="o">.</span><span class="nx">getUTCMonth</span><span class="o">()</span> <span class="o">+</span> <span class="m">1</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span>
94            <span class="nx">_zeroPad</span><span class="o">(</span><span class="nx">d</span><span class="o">.</span><span class="nx">getUTCDate</span><span class="o">())</span>      <span class="o">+</span> <span class="s1">&#39;T&#39;</span> <span class="o">+</span>
95            <span class="nx">_zeroPad</span><span class="o">(</span><span class="nx">d</span><span class="o">.</span><span class="nx">getUTCHours</span><span class="o">())</span>     <span class="o">+</span> <span class="s1">&#39;:&#39;</span> <span class="o">+</span>
96            <span class="nx">_zeroPad</span><span class="o">(</span><span class="nx">d</span><span class="o">.</span><span class="nx">getUTCMinutes</span><span class="o">())</span>   <span class="o">+</span> <span class="s1">&#39;:&#39;</span> <span class="o">+</span>
97            <span class="nx">_zeroPad</span><span class="o">(</span><span class="nx">d</span><span class="o">.</span><span class="nx">getUTCSeconds</span><span class="o">())</span>   <span class="o">+</span> <span class="s1">&#39;Z&quot;&#39;</span><span class="o">;</span>
98    <span class="o">},</span>
99
100    <span class="c">/**</span>
101<span class="c">     * Converts an arbitrary value to a JSON string representation.</span>
102<span class="c">     * Cyclical object or array references are replaced with null.</span>
103<span class="c">     * If a whitelist is provided, only matching object keys will be included.</span>
104<span class="c">     * If a depth limit is provided, objects and arrays at that depth will</span>
105<span class="c">     * be stringified as empty.</span>
106<span class="c">     * @method stringify</span>
107<span class="c">     * @param o {MIXED} any arbitrary object to convert to JSON string</span>
108<span class="c">     * @param w {Array|Function} (optional) whitelist of acceptable object</span>
109<span class="c">     *                  keys to include, or a replacer function to modify the</span>
110<span class="c">     *                  raw value before serialization</span>
111<span class="c">     * @param d {number} (optional) depth limit to recurse objects/arrays</span>
112<span class="c">     *                   (practical minimum 1)</span>
113<span class="c">     * @return {string} JSON string representation of the input</span>
114<span class="c">     * @static</span>
115<span class="c">     * @public</span>
116<span class="c">     */</span>
117    <span class="nx">stringify</span> <span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">o</span><span class="o">,</span><span class="nx">w</span><span class="o">,</span><span class="nx">d</span><span class="o">)</span> <span class="o">{</span>
118
119        <span class="k">var</span> <span class="nx">m</span>      <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">JSON</span><span class="o">.</span><span class="nx">_CHARS</span><span class="o">,</span>
120            <span class="nx">str_re</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">JSON</span><span class="o">.</span><span class="nx">_SPECIAL_CHARS</span><span class="o">,</span>
121            <span class="nx">rep</span>    <span class="o">=</span> <span class="k">typeof</span> <span class="nx">w</span> <span class="o">===</span> <span class="s1">&#39;function&#39;</span> <span class="o">?</span> <span class="nx">w</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
122            <span class="nx">pstack</span> <span class="o">=</span> <span class="o">[];</span> <span class="c">// Processing stack used for cyclical ref protection</span>
123<span class="c"></span>
124        <span class="k">if</span> <span class="o">(</span><span class="nx">rep</span> <span class="o">||</span> <span class="k">typeof</span> <span class="nx">w</span> <span class="o">!==</span> <span class="s1">&#39;object&#39;</span><span class="o">)</span> <span class="o">{</span>
125            <span class="nx">w</span> <span class="o">=</span> <span class="kc">undefined</span><span class="o">;</span>
126        <span class="o">}</span>
127
128        <span class="c">// escape encode special characters</span>
129<span class="c"></span>        <span class="k">var</span> <span class="nx">_char</span> <span class="o">=</span> <span class="k">function</span> <span class="o">(</span><span class="nx">c</span><span class="o">)</span> <span class="o">{</span>
130            <span class="k">if</span> <span class="o">(!</span><span class="nx">m</span><span class="o">[</span><span class="nx">c</span><span class="o">])</span> <span class="o">{</span>
131                <span class="nx">m</span><span class="o">[</span><span class="nx">c</span><span class="o">]=</span><span class="s1">&#39;\\u&#39;</span><span class="o">+(</span><span class="s1">&#39;0000&#39;</span><span class="o">+(+(</span><span class="nx">c</span><span class="o">.</span><span class="nx">charCodeAt</span><span class="o">(</span><span class="m">0</span><span class="o">))).</span><span class="nx">toString</span><span class="o">(</span><span class="m">16</span><span class="o">)).</span><span class="nx">slice</span><span class="o">(-</span><span class="m">4</span><span class="o">);</span>
132            <span class="o">}</span>
133            <span class="k">return</span> <span class="nx">m</span><span class="o">[</span><span class="nx">c</span><span class="o">];</span>
134        <span class="o">};</span>
135
136        <span class="c">// Enclose the escaped string in double quotes</span>
137<span class="c"></span>        <span class="k">var</span> <span class="nx">_string</span> <span class="o">=</span> <span class="k">function</span> <span class="o">(</span><span class="nx">s</span><span class="o">)</span> <span class="o">{</span>
138            <span class="k">return</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">+</span> <span class="nx">s</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="nx">str_re</span><span class="o">,</span> <span class="nx">_char</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;&quot;&#39;</span><span class="o">;</span>
139        <span class="o">};</span>
140
141        <span class="c">// Use the configured date conversion</span>
142<span class="c"></span>        <span class="k">var</span> <span class="nx">_date</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">JSON</span><span class="o">.</span><span class="nx">dateToString</span><span class="o">;</span>
143   
144        <span class="c">// Worker function.  Fork behavior on data type and recurse objects and</span>
145<span class="c"></span>        <span class="c">// arrays per the configured depth.</span>
146<span class="c"></span>        <span class="k">var</span> <span class="nx">_stringify</span> <span class="o">=</span> <span class="k">function</span> <span class="o">(</span><span class="nx">h</span><span class="o">,</span><span class="nx">key</span><span class="o">,</span><span class="nx">d</span><span class="o">)</span> <span class="o">{</span>
147            <span class="k">var</span> <span class="nx">o</span> <span class="o">=</span> <span class="k">typeof</span> <span class="nx">rep</span> <span class="o">===</span> <span class="s1">&#39;function&#39;</span> <span class="o">?</span> <span class="nx">rep</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">h</span><span class="o">,</span><span class="nx">key</span><span class="o">,</span><span class="nx">h</span><span class="o">[</span><span class="nx">key</span><span class="o">])</span> <span class="o">:</span> <span class="nx">h</span><span class="o">[</span><span class="nx">key</span><span class="o">],</span>
148                <span class="nx">t</span> <span class="o">=</span> <span class="k">typeof</span> <span class="nx">o</span><span class="o">,</span>
149                <span class="nx">i</span><span class="o">,</span><span class="nx">len</span><span class="o">,</span><span class="nx">j</span><span class="o">,</span> <span class="c">// array iteration</span>
150<span class="c"></span>                <span class="nx">k</span><span class="o">,</span><span class="nx">v</span><span class="o">,</span>     <span class="c">// object iteration</span>
151<span class="c"></span>                <span class="nx">a</span><span class="o">;</span>       <span class="c">// composition array for performance over string concat</span>
152<span class="c"></span>
153            <span class="c">// String</span>
154<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">t</span> <span class="o">===</span> <span class="s1">&#39;string&#39;</span><span class="o">)</span> <span class="o">{</span>
155                <span class="k">return</span> <span class="nx">_string</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>
156            <span class="o">}</span>
157
158            <span class="c">// native boolean and Boolean instance</span>
159<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">t</span> <span class="o">===</span> <span class="s1">&#39;boolean&#39;</span> <span class="o">||</span> <span class="nx">o</span> <span class="k">instanceof</span> <span class="nb">Boolean</span><span class="o">)</span> <span class="o">{</span>
160                <span class="k">return</span> <span class="nb">String</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>
161            <span class="o">}</span>
162
163            <span class="c">// native number and Number instance</span>
164<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">t</span> <span class="o">===</span> <span class="s1">&#39;number&#39;</span> <span class="o">||</span> <span class="nx">o</span> <span class="k">instanceof</span> <span class="nb">Number</span><span class="o">)</span> <span class="o">{</span>
165                <span class="k">return</span> <span class="nb">isFinite</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">?</span> <span class="nb">String</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">:</span> <span class="s1">&#39;null&#39;</span><span class="o">;</span>
166            <span class="o">}</span>
167
168            <span class="c">// Date</span>
169<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">o</span> <span class="k">instanceof</span> <span class="nb">Date</span><span class="o">)</span> <span class="o">{</span>
170                <span class="k">return</span> <span class="nx">_date</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>
171            <span class="o">}</span>
172
173            <span class="c">// Object types</span>
174<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">t</span> <span class="o">===</span> <span class="s1">&#39;object&#39;</span><span class="o">)</span> <span class="o">{</span>
175                <span class="k">if</span> <span class="o">(!</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
176                    <span class="k">return</span> <span class="s1">&#39;null&#39;</span><span class="o">;</span>
177                <span class="o">}</span>
178
179                <span class="c">// Check for cyclical references</span>
180<span class="c"></span>                <span class="k">for</span> <span class="o">(</span><span class="nx">i</span> <span class="o">=</span> <span class="nx">pstack</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&gt;=</span> <span class="m">0</span><span class="o">;</span> <span class="o">--</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
181                    <span class="k">if</span> <span class="o">(</span><span class="nx">pstack</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">===</span> <span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
182                        <span class="k">return</span> <span class="s1">&#39;null&#39;</span><span class="o">;</span>
183                    <span class="o">}</span>
184                <span class="o">}</span>
185
186                <span class="c">// Add the object to the processing stack</span>
187<span class="c"></span>                <span class="nx">pstack</span><span class="o">[</span><span class="nx">pstack</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">o</span><span class="o">;</span>
188
189                <span class="nx">a</span> <span class="o">=</span> <span class="o">[];</span>
190
191                <span class="c">// Only recurse if we&#39;re above depth config</span>
192<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="nx">d</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
193                    <span class="c">// Array</span>
194<span class="c"></span>                    <span class="k">if</span> <span class="o">(</span><span class="nx">isA</span><span class="o">(</span><span class="nx">o</span><span class="o">))</span> <span class="o">{</span>
195                        <span class="k">for</span> <span class="o">(</span><span class="nx">i</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&gt;=</span> <span class="m">0</span><span class="o">;</span> <span class="o">--</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
196                            <span class="nx">a</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_stringify</span><span class="o">(</span><span class="nx">o</span><span class="o">,</span><span class="nx">i</span><span class="o">,</span><span class="nx">d</span><span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">||</span> <span class="s1">&#39;null&#39;</span><span class="o">;</span>
197                        <span class="o">}</span>
198
199                    <span class="c">// Object</span>
200<span class="c"></span>                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
201                        <span class="c">// If whitelist provided, take only those keys</span>
202<span class="c"></span>                        <span class="nx">k</span> <span class="o">=</span> <span class="nx">isA</span><span class="o">(</span><span class="nx">w</span><span class="o">)</span> <span class="o">?</span> <span class="nx">w</span> <span class="o">:</span> <span class="nx">Y</span><span class="o">.</span><span class="nb">Object</span><span class="o">.</span><span class="nx">keys</span><span class="o">(</span><span class="nx">w</span><span class="o">||</span><span class="nx">o</span><span class="o">);</span>
203
204                        <span class="k">for</span> <span class="o">(</span><span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span> <span class="nx">j</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">k</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="o">++</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
205                            <span class="k">if</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">k</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">===</span> <span class="s1">&#39;string&#39;</span><span class="o">)</span> <span class="o">{</span>
206                                <span class="nx">v</span> <span class="o">=</span> <span class="nx">_stringify</span><span class="o">(</span><span class="nx">o</span><span class="o">,</span><span class="nx">k</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span><span class="nx">d</span><span class="o">-</span><span class="m">1</span><span class="o">);</span>
207                                <span class="k">if</span> <span class="o">(</span><span class="nx">v</span><span class="o">)</span> <span class="o">{</span>
208                                    <span class="nx">a</span><span class="o">[</span><span class="nx">j</span><span class="o">++]</span> <span class="o">=</span> <span class="nx">_string</span><span class="o">(</span><span class="nx">k</span><span class="o">[</span><span class="nx">i</span><span class="o">])</span> <span class="o">+</span> <span class="s1">&#39;:&#39;</span> <span class="o">+</span> <span class="nx">v</span><span class="o">;</span>
209                                <span class="o">}</span>
210                            <span class="o">}</span>
211                        <span class="o">}</span>
212                    <span class="o">}</span>
213                <span class="o">}</span>
214
215                <span class="c">// remove the array from the stack</span>
216<span class="c"></span>                <span class="nx">pstack</span><span class="o">.</span><span class="nx">pop</span><span class="o">();</span>
217
218                <span class="k">return</span> <span class="nx">isA</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39;[&#39;</span><span class="o">+</span><span class="nx">a</span><span class="o">.</span><span class="nx">join</span><span class="o">(</span><span class="s1">&#39;,&#39;</span><span class="o">)+</span><span class="s1">&#39;]&#39;</span> <span class="o">:</span> <span class="s1">&#39;{&#39;</span><span class="o">+</span><span class="nx">a</span><span class="o">.</span><span class="nx">join</span><span class="o">(</span><span class="s1">&#39;,&#39;</span><span class="o">)+</span><span class="s1">&#39;}&#39;</span><span class="o">;</span>
219            <span class="o">}</span>
220
221            <span class="k">return</span> <span class="kc">undefined</span><span class="o">;</span> <span class="c">// invalid input</span>
222<span class="c"></span>        <span class="o">};</span>
223
224        <span class="c">// Default depth to POSITIVE_INFINITY</span>
225<span class="c"></span>        <span class="nx">d</span> <span class="o">=</span> <span class="nx">d</span> <span class="o">&gt;=</span> <span class="m">0</span> <span class="o">?</span> <span class="nx">d</span> <span class="o">:</span> <span class="m">1</span><span class="o">/</span><span class="m">0</span><span class="o">;</span>
226
227        <span class="c">// process the input</span>
228<span class="c"></span>        <span class="k">return</span> <span class="nx">_stringify</span><span class="o">({</span><span class="s1">&#39;&#39;</span><span class="o">:</span><span class="nx">o</span><span class="o">},</span><span class="s1">&#39;&#39;</span><span class="o">,</span><span class="nx">d</span><span class="o">);</span>
229    <span class="o">}</span>
230<span class="o">});</span>
231</pre></div>
232                    </div>
233                        </div>
234                </div>
235                <div class="yui-b">
236            <div class="nav">
237
238                    <div class="module">
239                        <h4>Modules</h4>
240                        <ul class="content">
241
242                                <li class=""><a href="module_anim.html">anim</a></li>
243
244                                <li class=""><a href="module_attribute.html">attribute</a></li>
245
246                                <li class=""><a href="module_base.html">base</a></li>
247
248                                <li class=""><a href="module_cookie.html">cookie</a></li>
249
250                                <li class=""><a href="module_dd.html">dd</a></li>
251
252                                <li class=""><a href="module_dd-plugin.html">dd-plugin</a></li>
253
254                                <li class=""><a href="module_dom.html">dom</a></li>
255
256                                <li class=""><a href="module_dump.html">dump</a></li>
257
258                                <li class=""><a href="module_event.html">event</a></li>
259
260                                <li class=""><a href="module_io.html">io</a></li>
261
262                                <li class="selected"><a href="module_json.html">json</a></li>
263
264                                <li class=""><a href="module_node.html">node</a></li>
265
266                                <li class=""><a href="module_oop.html">oop</a></li>
267
268                                <li class=""><a href="module_queue.html">queue</a></li>
269
270                                <li class=""><a href="module_substitute.html">substitute</a></li>
271
272                                <li class=""><a href="module_yui.html">yui</a></li>
273                        </ul>
274                    </div>
275
276                    <div class="module">
277                        <h4>Classes</h4>
278                        <ul class="content">
279                                <li class=""><a href="JSON.html">JSON</a></li>
280                        </ul>
281                    </div>
282
283                    <div class="module">
284                        <h4>Files</h4>
285                        <ul class="content">       
286                                <li class=""><a href="json-parse.js.html">json-parse.js</a></li>
287                                <li class="selected"><a href="json-stringify.js.html">json-stringify.js</a></li>
288                        </ul>
289                    </div>
290
291
292
293
294
295            </div>
296                </div>
297        </div>
298        <div id="ft">
299        <hr />
300        Copyright &copy; 2008 Yahoo! Inc. All rights reserved.
301        </div>
302</div>
303</body>
304</html>
Note: See TracBrowser for help on using the repository browser.