michael@0: // for-in loops on Maps and Sets enumerate properties. michael@0: michael@0: var test = function test(obj) { michael@0: assertEq(Object.keys(obj).length, 0); michael@0: michael@0: var i = 0, v; michael@0: for (v in obj) michael@0: i++; michael@0: assertEq(i, 0); michael@0: michael@0: obj.ownProp = 1; michael@0: assertEq(Object.keys(obj).join(), "ownProp"); michael@0: michael@0: for (v in obj) michael@0: i++; michael@0: assertEq(i, 1); michael@0: assertEq(v, "ownProp"); michael@0: michael@0: delete obj.ownProp; michael@0: }; michael@0: michael@0: test(Map.prototype); michael@0: test(new Map); michael@0: test(Set.prototype); michael@0: test(new Set);