1 2 3 4 5 6 7 8 9 10 11 12
var obj = { method() { } }; assertThrowsInstanceOf(() => { new obj.method; }, TypeError); obj = { constructor() { } }; assertThrowsInstanceOf(() => { new obj.constructor; }, TypeError); if (typeof reportCompare === "function") reportCompare(true, true);