| OLD | NEW |
| (Empty) |
| 1 Test behaviour of JSON reviver function. | |
| 2 | |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
| 4 | |
| 5 | |
| 6 | |
| 7 Ensure the holder for our array is indeed an array | |
| 8 PASS Array.isArray(currentHolder) is true | |
| 9 PASS currentHolder.length is 5 | |
| 10 | |
| 11 Ensure that the holder already has all the properties present at the start of fi
ltering | |
| 12 PASS currentHolder[0] is "a value" | |
| 13 PASS currentHolder[1] is "another value" | |
| 14 PASS currentHolder[2] is "and another value" | |
| 15 PASS currentHolder[3] is "to delete" | |
| 16 PASS currentHolder[4] is "extra value" | |
| 17 | |
| 18 Ensure the holder for our array is indeed an array | |
| 19 PASS Array.isArray(currentHolder) is true | |
| 20 PASS currentHolder.length is 5 | |
| 21 | |
| 22 Ensure that we always get the same holder | |
| 23 PASS currentHolder is lastHolder | |
| 24 | |
| 25 Ensure that returning undefined has removed the property 0 from the holder durin
g filtering. | |
| 26 FAIL currentHolder.hasOwnProperty(0) should be false. Was true. | |
| 27 | |
| 28 Ensure the holder for our array is indeed an array | |
| 29 PASS Array.isArray(currentHolder) is true | |
| 30 PASS currentHolder.length is 5 | |
| 31 | |
| 32 Ensure that we always get the same holder | |
| 33 PASS currentHolder is lastHolder | |
| 34 | |
| 35 Ensure that changing the value of a property is reflected while filtering. | |
| 36 PASS currentHolder[2] is "a replaced value" | |
| 37 | |
| 38 Ensure that the changed value is reflected in the arguments passed to the revive
r | |
| 39 PASS value is currentHolder[2] | |
| 40 | |
| 41 Ensure the holder for our array is indeed an array | |
| 42 PASS Array.isArray(currentHolder) is true | |
| 43 PASS currentHolder.length is 5 | |
| 44 | |
| 45 Ensure that we always get the same holder | |
| 46 PASS currentHolder is lastHolder | |
| 47 | |
| 48 Ensure that we visited a value that we have deleted, and that deletion is reflec
ted while filtering. | |
| 49 PASS currentHolder.hasOwnProperty(3) is false | |
| 50 | |
| 51 Ensure that when visiting a deleted property value is undefined | |
| 52 PASS value is undefined. | |
| 53 | |
| 54 Ensure the holder for our array is indeed an array | |
| 55 PASS Array.isArray(currentHolder) is true | |
| 56 FAIL currentHolder.length should be 3. Was 4. | |
| 57 | |
| 58 Ensure that we always get the same holder | |
| 59 PASS currentHolder is lastHolder | |
| 60 FAIL Did not call reviver for deleted property | |
| 61 | |
| 62 Ensure that we created the root holder as specified in ES5 | |
| 63 PASS '' in lastHolder is true | |
| 64 PASS result is lastHolder[''] | |
| 65 | |
| 66 Ensure that a deleted value is revived if the reviver function returns a value | |
| 67 FAIL result.hasOwnProperty(3) should be true. Was false. | |
| 68 | |
| 69 Test behaviour of revivor used in conjunction with an object | |
| 70 PASS currentHolder != globalObject is true | |
| 71 | |
| 72 Ensure that the holder already has all the properties present at the start of fi
ltering | |
| 73 PASS currentHolder['a property'] is "a value" | |
| 74 PASS currentHolder['another property'] is "another value" | |
| 75 PASS currentHolder['and another property'] is "and another value" | |
| 76 PASS currentHolder['to delete'] is "will be deleted" | |
| 77 PASS currentHolder != globalObject is true | |
| 78 | |
| 79 Ensure that we get the same holder object for each property | |
| 80 PASS currentHolder is lastHolder | |
| 81 | |
| 82 Ensure that returning undefined has correctly removed the property 'a property'
from the holder object | |
| 83 PASS currentHolder.hasOwnProperty('a property') is false | |
| 84 PASS currentHolder != globalObject is true | |
| 85 | |
| 86 Ensure that we get the same holder object for each property | |
| 87 PASS currentHolder is lastHolder | |
| 88 Ensure that changing the value of a property is reflected while filtering. | |
| 89 PASS currentHolder['and another property'] is "a replaced value" | |
| 90 | |
| 91 Ensure that the changed value is reflected in the arguments passed to the revive
r | |
| 92 PASS value is "a replaced value" | |
| 93 | |
| 94 Ensure that we created the root holder as specified in ES5 | |
| 95 PASS lastHolder.hasOwnProperty('') is true | |
| 96 PASS result.hasOwnProperty('a property') is false | |
| 97 FAIL result.hasOwnProperty('to delete') should be true. Was false. | |
| 98 PASS result is lastHolder[''] | |
| 99 | |
| 100 Test behaviour of revivor that introduces a cycle | |
| 101 PASS JSON.parse("[0,1]", reviveAddsCycle) threw exception RangeError: Maximum ca
ll stack size exceeded. | |
| 102 | |
| 103 Test behaviour of revivor that introduces a new array classed object (the result
of a regex) | |
| 104 PASS JSON.stringify(JSON.parse("[0,1]", reviveIntroducesNewArrayLikeObject)) is
'[0,["a","a"]]' | |
| 105 PASS successfullyParsed is true | |
| 106 | |
| 107 TEST COMPLETE | |
| 108 | |
| OLD | NEW |