michael@0: // Some testing for JSOP_NEW. michael@0: function foo(prop) { michael@0: this.name = "Foo"; michael@0: this.prop = prop; michael@0: return this; michael@0: } michael@0: michael@0: // Construct an object with a unique assignation to a property. michael@0: function f(i) { michael@0: var x = new foo(i); michael@0: return x.prop; michael@0: } michael@0: michael@0: // Assert that a unique object really was created. michael@0: for (var i = 0; i < 100; i++) michael@0: assertEq(f(i), i);