ericdrowell/KineticJS — pull request #86 by davonium (2012-09-02 13:15:09+00:00)
Title: Improved the object oriented design

Super class should not be aware of sub class. For instance, Node should not contain code like:
if (this.nodeType === "Layer")
This should be handled by Layer by inheritance (then it will also work for new sub nodes if implementet).

While doing this I also repaired setZIndex for layer.

btw, why is isAncestorOf always returning true for stage? I kept it the same way, but isn't it possible to have many stages or shapes that are not in any stage? I don't see why this should be handled separately.