[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 /** 2 * @requires javelin-json 3 */ 4 5 describe('JSON', function() { 6 7 it('should encode and decode an object', function() { 8 var object = { 9 a: [0, 1, 2], 10 s: "Javelin Stuffs", 11 u: '\x01', 12 n: 1, 13 f: 3.14, 14 b: false, 15 nil: null, 16 o: { 17 a: 1, 18 b: [1, 2], 19 c: { 20 a: 2, 21 b: 3 22 } 23 } 24 }; 25 26 expect(JX.JSON.parse(JX.JSON.stringify(object))).toEqual(object); 27 }); 28 29 it('should encode undefined array indices as null', function() { 30 var a = []; 31 a.length = 2; 32 var o = { x : a }; 33 expect(JX.JSON.stringify(o)).toEqual('{"x":[null,null]}'); 34 }); 35 36 });
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |