michael@0: michael@0: var o2 = Proxy.create({}); michael@0: function f1() {} michael@0: function f2() {} michael@0: function f4(o) { michael@0: var key = Object.getOwnPropertyNames(o)[18]; michael@0: o4 = o[key]; michael@0: o.prototype = {}; michael@0: } michael@0: f4(f1); michael@0: f4(f1); michael@0: f4(f2); michael@0: new f2(o2); michael@0: michael@0: // these will hold only if type inference is enabled. michael@0: //assertEq(shapeOf(f1) == shapeOf(f2), false); michael@0: //assertEq(shapeOf(f1) == shapeOf(f4), false); michael@0: michael@0: function factory() { michael@0: function foo() {} michael@0: foo.x = 0; michael@0: return foo; michael@0: } michael@0: michael@0: var fobjs = []; michael@0: for (var i = 0; i < 10; i++) { michael@0: var of = fobjs[i] = factory(); michael@0: if (i > 0) { michael@0: assertEq(fobjs[i - 1] === of, false); michael@0: assertEq(shapeOf(fobjs[i - 1]), shapeOf(of)); michael@0: } michael@0: } michael@0: michael@0: assertEq(shapeOf(fobjs[0]) == shapeOf(f1), false);