Lines Matching refs: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;
234 v, // The member value.
238 value = holder[key];
240 // If the value has a toJSON method, call it to obtain a replacement value.
242 if (value && typeof value === 'object' &&
243 typeof value.toJSON === 'function') {
244 value = value.toJSON(key);
248 // obtain a replacement value.
251 value = rep.call(holder, key, value);
254 // What happens next depends on the value's type.
256 switch (typeof value) {
258 return quote(value);
264 return isFinite(value) ? String(value) : 'null';
269 // If the value is a boolean or null, convert it to a string. Note:
273 return String(value);
283 if (!value) {
287 // Make an array to hold the partial results of stringifying this object value.
292 // Is the value an array?
294 if (Object.prototype.toString.apply(value) === '[object Array]') {
296 // The value is an array. Stringify every element. Use null as a placeholder
299 length = value.length;
301 partial[i] = str(i, value) || 'null';
323 v = str(k, value);
333 for (k in value) {
334 if (Object.prototype.hasOwnProperty.call(value, k)) {
335 v = str(k, value);
359 JSON.stringify = function (value, replacer, space) {
361 // The stringify method takes a value and an optional replacer, and an optional
395 // Make a fake root object containing our value under the key of ''.
396 // Return the result of stringifying the value.
398 return str('', {'': value});
409 // a JavaScript value if the text is a valid JSON text.
418 var k, v, value = holder[key];
419 if (value && typeof value === 'object') {
420 for (k in value) {
421 if (Object.prototype.hasOwnProperty.call(value, k)) {
422 v = walk(value, k);
424 value[k] = v;
426 delete value[k];
431 return reviver.call(holder, key, value);
456 // replace all simple value tokens with ']' characters. Third, we delete all
474 // each name/value pair to a reviver function for possible transformation.