- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Mon, 02 Dec 2013 14:53:14 -0500
- To: www-dom@w3.org
On 12/2/13 2:08 PM, Tab Atkins Jr. wrote: > You can satisfy #1 and #3 if you implement things in the obvious way: > > HTML.h1 = function(...args) { return new HTMLHeadingElement("h1", ...args); }; > HTML.h1.prototype = HTMLHeadingElement.prototype; No. instanceof walks up the proto chain but then looks for the .constructor of the things on the proto chain matching the RHS. So in fact, the only thing you can manage if you have multiple constructors is Object.getPrototypeOf(new X()) === X.prototype for both constructors. -Boris
Received on Monday, 2 December 2013 19:53:44 UTC