- From: Joe Pea <notifications@github.com>
- Date: Sat, 30 Nov 2019 11:08:28 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Saturday, 30 November 2019 19:08:30 UTC
<!-- At a higher level I bet this is simply architecture design that people aren't willing to modify (though they probably can if they tried). The question to that is, if it can be done with backwards compatibility, then why not? I don't think that adding Proxy support (and changing underlying architecture) would break backwards compatibility in this case. Obviously we could totally change the "type" of an object by using a Proxy wrapper, but then we'd find out very quickly that shooting ourselves in the foot is not going to get us anywhere. --> > the “why” part of this Would you mind summarizing some bullet points? ---- This totally works: ```js class MyEl extends HTMLElement { constructor() { super(); Object.setPrototypeOf( this, new Proxy(Object.create(HTMLElement.prototype), { get(...args) { console.log("Muahaha."); return undefined; }, set(...args) { console.log("Muahaha."); return true; } }) ); } } customElements.define("my-el3", MyEl); const el = new MyEl(); document.body.appendChild(el); ``` -- 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/857#issuecomment-560012716
Received on Saturday, 30 November 2019 19:08:30 UTC