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