michael@0: michael@0: var global = 0; michael@0: michael@0: Object.defineProperty(Object.prototype, 0, {set: function() { global++; }}); michael@0: michael@0: for (var x = 0; x < 20; ++x) michael@0: [1,2]; michael@0: assertEq(global, 0); michael@0: michael@0: Object.defineProperty(Object.prototype, 1, {set: function() { global++; }}); michael@0: michael@0: for (var x = 0; x < 20; ++x) michael@0: [1,2]; michael@0: assertEq(global, 0); michael@0: michael@0: Object.defineProperty(Object.prototype, "b", {set: function() { global++; }}); michael@0: michael@0: for (var x = 0; x < 20; ++x) { michael@0: var s = { a:0, b:1, 0: 2, 1: 3 }; michael@0: } michael@0: assertEq(global, 0); michael@0: michael@0: assertEq([42][0], 42); michael@0: assertEq([42].length, 1);