| Test to ensure correct behaviour of replacer functions in JSON.stringify |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| PASS JSON.stringify(object, returnUndefined) is undefined. |
| PASS JSON.stringify(array, returnUndefined) is undefined. |
| PASS JSON.stringify(object, returnObjectFor1) is '{"0":0,"1":{},"2":2}' |
| PASS JSON.stringify(array, returnObjectFor1) is '[0,{},2,null]' |
| PASS JSON.stringify(object, returnArrayFor1) is '{"0":0,"1":[],"2":2}' |
| PASS JSON.stringify(array, returnArrayFor1) is '[0,[],2,null]' |
| PASS JSON.stringify(object, returnUndefinedFor1) is '{"0":0,"2":2}' |
| PASS JSON.stringify(array, returnUndefinedFor1) is '[0,null,2,null]' |
| PASS JSON.stringify(object, returnFunctionFor1) is '{"0":0,"2":2}' |
| PASS JSON.stringify(array, returnFunctionFor1) is '[0,null,2,null]' |
| PASS JSON.stringify(object, returnNullFor1) is '{"0":0,"1":null,"2":2}' |
| PASS JSON.stringify(array, returnNullFor1) is '[0,null,2,null]' |
| PASS JSON.stringify(object, returnStringForUndefined) is '{"0":0,"1":1,"2":2,"3":"undefined value"}' |
| PASS JSON.stringify(array, returnStringForUndefined) is '[0,1,2,"undefined value"]' |
| PASS JSON.stringify(object, returnCycleObjectFor1) threw exception TypeError: JSON.stringify cannot serialize cyclic structures.. |
| PASS JSON.stringify(array, returnCycleObjectFor1) threw exception TypeError: JSON.stringify cannot serialize cyclic structures.. |
| PASS JSON.stringify(object, returnCycleArrayFor1) threw exception TypeError: JSON.stringify cannot serialize cyclic structures.. |
| PASS JSON.stringify(array, returnCycleArrayFor1) threw exception TypeError: JSON.stringify cannot serialize cyclic structures.. |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |