michael@0: // Call an Ion constructor from the interpreter. michael@0: michael@0: // This gets compiled and called by the interpreter. michael@0: // Allocation and primitive check need to happen caller-side. michael@0: function Foo() { michael@0: this.x = 5; michael@0: return 4; michael@0: } michael@0: michael@0: eval("//nothing"); // Prevent compilation of global script. michael@0: michael@0: for (var i = 0; i < 100; i++) { michael@0: var x = new Foo(); michael@0: assertEq(typeof(x), "object"); michael@0: }