I am using a JavaScript library that exposes a constructor as a property of a global object.
In JavaScript, I can call the constructor like this.
var thing = new Library.Thing();
How do I call the constructor in ClojureScript? None of these work.
; These all cause compiler errors
(new (.-Thing js/Library)) ; First arg to new must be a symbol
(new (.Thing js/Library))
(new .-Thing js/Library)
(new .Thing js/Library)
(new js/Library/Thing) ; Invalid token: js/Library/Thing
; These all compile to different JS than I am looking for
((.-Thing js/Library).) ; Library.Thing.call(null, _SLASH_);
((.Thing js/Library).) ; Library.Thing().call(null, _SLASH_);
It works fine if I use js* but that's cheating, right?
(js* "new Library.Thing()")
What is the proper way to call a constructor function that is a property of another object?