ancestors
(ancestors tag)
(ancestors h tag)
See Also:
Source docstring:
Returns the immediate and indirect parents of tag, either via a JavaScript type
inheritance relationship or a relationship established via derive. h
must be a hierarchy obtained from make-hierarchy, if not supplied
defaults to the global hierarchy
(defn ancestors
([tag] (ancestors @(get-global-hierarchy) tag))
([h tag]
(not-empty
(let [ta (get (:ancestors h) tag)]
(if (js-fn? tag)
(let [superclasses (set (supers tag))]
(reduce into superclasses
(cons ta
(map #(get (:ancestors h) %) superclasses))))
ta)))))