danieldietrich / candid

Candid is a surprisingly fresh and frameworkless JavaScript library for building web applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proper dynamic class definition using the prototype chain

danieldietrich opened this issue · comments

The current custom class definition works find (at least in Chrome and Safari). Do we additionally need to define the constructor explicitly?

CustomElement.prototype.constructor = CustomElement.prototype.constructor`

We should test all scenarios, including new(), document.createElement('my-element') and maybe even Reflect.construct().

Solved with #11, see also #17