Welcome! Please see the About page for a little more info on how this works.

+1 vote
ago in ClojureScript by

Hello

In Clojure, I can do:

(parents String)
; #{java.lang.constant.ConstantDesc java.lang.Object java.lang.CharSequence java.io.Serializable java.lang.constant.Constable java.lang.Comparable}

But in ClojureScript:

(parents js/String)
; nil

ClojureScript's parents doc does mention "JavaScript type inheritance":

Returns the immediate 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

Is there something wrong with the syntax I used?

Is parents really supposed to work with JavaScript inheritance on ClojureScript?

ago by
Quoting David Nolen when I mentioned that the docstring might be wrong: "well, more like [proxy is] unfinished - we should fix that not the docstring".

1 Answer

+1 vote
ago by
selected ago by
 
Best answer

Hi! We can probably walk the prototype chain. It's just an oversight as this is not a commonly used feature. I created https://clojure.atlassian.net/browse/CLJS-3464. Patch welcome of course!

ago by
Will be resolved in the next release https://github.com/clojure/clojurescript/commit/9f77604d532c9ee831e0b300def280b669e780a0 - probably Monday December 1 2025.
ago by
Great! Thank you for the answer and for the patch :)
...