Home | History | Annotate | Download | only in hosted

Lines Matching full:value

22         JSON.stringify(value, replacer, space)
23 value any JavaScript value, usually an object or array.
36 This method produces a JSON text from a JavaScript value.
38 When an object value is found, if the object contains a toJSON
41 value represented by the name/value pair that should be serialized,
43 will be passed the key associated with the value, and this will be
44 bound to the value
63 key and value of each member, with this bound to the containing
64 object. The value that is returned from your method will be
80 value that is filled with line breaks and indentation to make it
96 text = JSON.stringify([new Date()], function (key, value) {
98 'Date(' + this[key] + ')' : value;
109 and its return value is used instead of the original value.
118 myData = JSON.parse(text, function (key, value) {
120 if (typeof value === 'string') {
122 /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
128 return value;
131 myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
133 if (typeof value === 'string' &&
134 value.slice(0, 5) === 'Date(' &&
135 value.slice(-1) === ')') {
136 d = new Date(value.slice(5, -1));
141 return value;
233 v, // The member value.
237 value = holder[key];
239 // If the value has a toJSON method, call it to obtain a replacement value.
241 if (value && typeof value === 'object' &&
242 typeof value.toJSON === 'function') {
243 value = value.toJSON(key);
247 // obtain a replacement value.
250 value = rep.call(holder, key, value);
253 // What happens next depends on the value's type.
255 switch (typeof value) {
257 return quote(value);
263 return isFinite(value) ? String(value) : 'null';
268 // If the value is a boolean or null, convert it to a string. Note:
272 return String(value);
282 if (!value) {
286 // Make an array to hold the partial results of stringifying this object value.
291 // Is the value an array?
293 if (Object.prototype.toString.apply(value) === '[object Array]') {
295 // The value is an array. Stringify every element. Use null as a placeholder
298 length = value.length;
300 partial[i] = str(i, value) || 'null';
322 v = str(k, value);
332 for (k in value) {
333 if (Object.hasOwnProperty.call(value, k)) {
334 v = str(k, value);
356 JSON.stringify = function (value, replacer, space) {
358 // The stringify method takes a value and an optional replacer, and an optional
392 // Make a fake root object containing our value under the key of ''.
393 // Return the result of stringifying the value.
395 return str('', {'': value});
406 // a JavaScript value if the text is a valid JSON text.
415 var k, v, value = holder[key];
416 if (value && typeof value === 'object') {
417 for (k in value) {
418 if (Object.hasOwnProperty.call(value, k)) {
419 v = walk(value, k);
421 value[k] = v;
423 delete value[k];
428 return reviver.call(holder, key, value);
452 // replace all simple value tokens with ']' characters. Third, we delete all
470 // each name/value pair to a reviver function for possible transformation.