Lines Matching full:stringify
226 // Stringify
229 assertEquals(expected, JSON.stringify(input));
230 assertEquals(expected, JSON.stringify(input, null, 0));
250 assertEquals("[\n 1,\n 2,\n 3\n]", JSON.stringify([1, 2, 3], null, 1));
251 assertEquals("[\n 1,\n 2,\n 3\n]", JSON.stringify([1, 2, 3], null, 2));
253 JSON.stringify([1, 2, 3], null, new Number(2)));
254 assertEquals("[\n^1,\n^2,\n^3\n]", JSON.stringify([1, 2, 3], null, "^"));
256 JSON.stringify([1, 2, 3], null, new String("^")));
258 JSON.stringify([1, 2, [3, [4], 5], 6, 7], null, 1));
259 assertEquals("[]", JSON.stringify([], null, 1));
261 JSON.stringify([1, 2, [3, [4], 5], 6, 7], null));
263 JSON.stringify([1, 2, [3, [4], 5], 6, 7], DoubleNumbers));
277 JSON.stringify({ get getter() { counter++; return 123; } }));
280 JSON.stringify({ get getter() { counter++; return 123; } },
309 assertThrows(function () { JSON.stringify(circular); }, TypeError);
310 assertThrows(function () { JSON.stringify(circular, null, 0); }, TypeError);
317 assertEquals('{"x":5}', JSON.stringify({x:5,y:6}, ['x']));
319 JSON.stringify({a:"b",c:"d"}, null, 1));
320 assertEquals('{"y":6,"x":5}', JSON.stringify({x:5,y:6}, ['y', 'x']));
330 JSON.stringify({a:"b",c:"d"}, null,
335 JSON.stringify({a:"b",c:"d"}, null, 15));
339 assertEquals('{"x":"42"}', JSON.stringify({x: String}, newx));
340 assertEquals('{"x":42}', JSON.stringify({x: Number}, newx));
341 assertEquals('{"x":true}', JSON.stringify({x: Boolean}, newx));
352 JSON.stringify({a: undefined, b: function(){}, c: 42, d: 42},
370 var encoded = JSON.stringify(string);