Lines Matching refs:text

30                         of nested structures. If it is omitted, the text will
36 This method produces a JSON text from a JavaScript value.
89 text = JSON.stringify(['e', {pluribus: 'unum'}]);
90 // text is '["e",{"pluribus":"unum"}]'
93 text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
94 // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
96 text = JSON.stringify([new Date()], function (key, value) {
100 // text is '["Date(---current time---)"]'
103 JSON.parse(text, reviver)
104 This method parses a JSON text to produce an object or array.
115 // Parse the text. Values that look like ISO date strings will
118 myData = JSON.parse(text, function (key, value) {
362 // space parameter, and returns a JSON text. The replacer can be a function
365 // produce text that is more easily readable.
406 JSON.parse = function (text, reviver) {
408 // The parse method takes a text and an optional reviver function, and returns
409 // a JavaScript value if the text is a valid JSON text.
439 text = String(text);
441 if (cx.test(text)) {
442 text = text.replace(cx, function (a) {
448 // In the second stage, we run the text against regular expressions that look
457 // open brackets that follow a colon or comma or that begin the text. Finally,
459 // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
462 .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
466 // In the third stage we use the eval function to compile the text into a
468 // in JavaScript: it can begin a block or an object literal. We wrap the text
471 j = eval('(' + text + ')');
481 // If the text is not JSON parseable, then a SyntaxError is thrown.