michael@0: var obj; michael@0: var counter = 0; michael@0: var p = Proxy.create({ michael@0: has : function(id) { michael@0: if (id == 'xyz') { michael@0: ++counter; michael@0: if (counter == 7) { michael@0: obj.__proto__ = null; michael@0: } michael@0: return true; michael@0: } michael@0: return false; michael@0: }, michael@0: get : function(id) { michael@0: if (id == 'xyz') michael@0: return 10; michael@0: } michael@0: }); michael@0: michael@0: function test() michael@0: { michael@0: Object.prototype.__proto__ = null; michael@0: obj = { xyz: 1}; michael@0: var n = 0; michael@0: for (var i = 0; i != 100; ++i) { michael@0: var s = obj.xyz; michael@0: if (s) michael@0: ++n; michael@0: if (i == 10) { michael@0: delete obj.xyz; michael@0: Object.prototype.__proto__ = p; michael@0: } michael@0: michael@0: } michael@0: } michael@0: michael@0: try { michael@0: test(); michael@0: } catch (e) {}