Index: test/mjsunit/json.js |
diff --git a/test/mjsunit/json.js b/test/mjsunit/json.js |
index c72c153688c76312c273e0cfb20e63bc8df89170..061189589f1e96b8816d6289d4c6ffc80ece4882 100644 |
--- a/test/mjsunit/json.js |
+++ b/test/mjsunit/json.js |
@@ -140,9 +140,16 @@ var pointJson = '{"x": 1, "y": 2}'; |
assertEquals({'x': 1, 'y': 2}, JSON.parse(pointJson)); |
assertEquals({'x': 1}, JSON.parse(pointJson, GetFilter('y'))); |
assertEquals({'y': 2}, JSON.parse(pointJson, GetFilter('x'))); |
+ |
assertEquals([1, 2, 3], JSON.parse("[1, 2, 3]")); |
-assertEquals([1, undefined, 3], JSON.parse("[1, 2, 3]", GetFilter(1))); |
-assertEquals([1, 2, undefined], JSON.parse("[1, 2, 3]", GetFilter(2))); |
+ |
+var array1 = JSON.parse("[1, 2, 3]", GetFilter(1)); |
+assertEquals([1, , 3], array1); |
+assertFalse(array1.hasOwnProperty(1)); // assertEquals above is not enough |
+ |
+var array2 = JSON.parse("[1, 2, 3]", GetFilter(2)); |
+assertEquals([1, 2, ,], array2); |
+assertFalse(array2.hasOwnProperty(2)); |
function DoubleNumbers(key, value) { |
return (typeof value == 'number') ? 2 * value : value; |