Hacker News new | ask | show | jobs
by rudasn 4995 days ago
Is there a particular reason you are using Hawk.def and Hawk.gen instead of something more "traditional" like

    Bird = Hawk.create(...)
    falcon = new Bird(...)
How do you deal with inheritance?

    falcon insteanceof Bird; // => is it true?

If bird had mixins would falcon be an instanceof those as well?
2 comments

Gen is because I use the word generate often in my code, and def rubbed off from Ext.define, no other special reason.

As for instance of, It's something I overlooked in testing, so I'm going to check that now, but my guess is that without mixing it should pass, but with it would fail because of the way I'm just pointing to function references.

Be back in a few with result, thanks for the feedback.

instanceof will fail right now, because I'm not using function constructors and prototype to create the classes. So I'm going to switch it to work that way so checks like instanceof work appropriately. I'll have to see how this affects mixins when i'm done with the changes.
Changed classes and mixins to use function constructors, so instanceof operator will work for both scenarios.