- From: Ibrahim Tanyalcin <notifications@github.com>
- Date: Sat, 06 Oct 2018 02:06:32 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Saturday, 6 October 2018 09:06:53 UTC
For webcomponents, I was just experimenting with @justinfagnani post, and it seems to work properly even if we remove <code>Object.setPrototypeOf(MyEl, HTMLElement);</code>. I am aware that for some reason, DOM constructor's __proto__ points to its prototype's constructor instead of Function.prototype, for instance: <code> HTMLElement.__proto__ === Element //true Element.__proto__ === Node //also true </code> Normally, I would expect a constructor's __proto__ to point to Function.prototype, so I "presume" @justinfagnani used <code>Object.setPrototypeOf(MyEl, HTMLElement);</code> for consistency in the way the Browser laid out their inheritence. Question is this: > Apart from "static" properties not being inherited (such as <code>Element._someStaticProperty === MyEl._someStaticProperty</code>) by the custom element, is there any side effect of removing <code>Object.setPrototypeOf(MyEl, HTMLElement);</code> all together? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/766#issuecomment-427558574
Received on Saturday, 6 October 2018 09:06:53 UTC