michael@0: // Try to test that we handle shape regeneration correctly. michael@0: // This is a fragile test, but as of this writing, on dmandelin's michael@0: // windows box, we have the same shape number with different michael@0: // logical shapes in the two assertEq lines. michael@0: michael@0: var o; michael@0: var p; michael@0: var zz; michael@0: var o2; michael@0: michael@0: function f(x) { michael@0: return x.a; michael@0: } michael@0: michael@0: gczeal(1); michael@0: gc(); michael@0: michael@0: zz = { q: 11 }; michael@0: o = { a: 77, b: 88 }; michael@0: o2 = { c: 11 }; michael@0: p = { b: 99, a: 11 }; michael@0: michael@0: //print('s ' + shapeOf(zz) + ' ' + shapeOf(o) + ' ' + shapeOf(o2) + ' ' + shapeOf(p)); michael@0: michael@0: assertEq(f(o), 77); michael@0: michael@0: o = undefined; michael@0: michael@0: gczeal(1); michael@0: gc(); michael@0: //print('s ' + 'x' + ' ' + shapeOf(p)); michael@0: michael@0: assertEq(f(p), 11);