roman01la / javascript-to-clojurescript

JavaScript to ClojureScript translator
https://roman01la.github.io/javascript-to-clojurescript/
103 stars 6 forks source link

Wrong translation direct Object prototype #1

Closed ampersanda closed 2 years ago

ampersanda commented 6 years ago

I am trying to translate Blotter JS sample from the site to Clojurescript

var text = new Blotter.Text("observation", {
  family : "'EB Garamond', serif",
  size : 27,
  fill : "#171717",
  paddingLeft : 40,
  paddingRight : 40
});

from the Translator I get the result (I add js/ by myself)

(def text
  (new (.Text js/Blotter)
    "observation"
    #js {:family "'EB Garamond', serif", :size 27, :fill "#171717", :paddingLeft 40, :paddingRight 40}))

which should be

(def text
  (new js/Blotter.Text 
    "observation"
    #js {:family "'EB Garamond', serif", :size 27, :fill "#171717", :paddingLeft 40, :paddingRight 40}))

the translated one is wrong because the Blotter is called the constructor new Blotter() (I think, correct me if I'm wrong).