Re: [w3c/webcomponents] defineElement should not cache lifecycle callbacks and prototype of a custom element class (#417)

I brought this up at TC39 in a couple hallway discussions, and the general consensus was that although late-binding is important for things called by other developers, it's an antipattern for things called by the platform. That is why, for example, subclassing hooks in ES6 are done using late binding, but JSON parsing on the platform doesn't go through `JSON.parse` but instead uses the JSON parsing algorithm directly, and `async`/`await` does not go through `Promise.prototype.then` but uses PromisePerformThen directly, and reading data from an ArrayBuffer does not use the public `.length` property but uses [[ArrayBufferByteLength]] directly.

I think that point of view is pretty aligned with the current spec actually, and makes me even more comfortable with the current design. It not only matches the web platform (no late-binding for overriding attribute setting via changing `setAttribute`), but matches the JavaScript language design philosophy as well.

---
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/417#issuecomment-204569197

Received on Friday, 1 April 2016 21:22:21 UTC