Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 function bogusConstruct(target) { return 4; }
2 function bogusConstructUndefined(target) { }
4 var handler = { construct: bogusConstruct }
6 function callable() {}
8 var p = new Proxy(callable, handler);
10 assertThrowsInstanceOf(function () { new p(); }, TypeError,
11 "[[Construct must throw if an object is not returned.");
13 handler.construct = bogusConstructUndefined;
14 assertThrowsInstanceOf(function () { new p(); }, TypeError,
15 "[[Construct must throw if an object is not returned.");
17 if (typeof reportCompare === "function")
18 reportCompare(0,0, "OK");