michael@0: function bogusConstruct(target) { return 4; } michael@0: function bogusConstructUndefined(target) { } michael@0: michael@0: var handler = { construct: bogusConstruct } michael@0: michael@0: function callable() {} michael@0: michael@0: var p = new Proxy(callable, handler); michael@0: michael@0: assertThrowsInstanceOf(function () { new p(); }, TypeError, michael@0: "[[Construct must throw if an object is not returned."); michael@0: michael@0: handler.construct = bogusConstructUndefined; michael@0: assertThrowsInstanceOf(function () { new p(); }, TypeError, michael@0: "[[Construct must throw if an object is not returned."); michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(0,0, "OK");