On Tue, Jul 10, 2012 at 12:23 PM, Praki <praki.prak...@gmail.com> wrote: > Hi, > > The javascript code generated for the following clojurescript is wrong. The > problem is, if the protocol name is hyphenated, the generated name is > treating that as an arithmetic expression rather than translating the hyphen > to underscore. The git tag of clojurescript is r1443. > > I am not very familiar with the compiler source to locate the root cause. > Can somebody point me in the right direction to fix this? > > > ============== cljs ================= > (ns bug) > > (defprotocol foo-bar-p > (qux[this]) > (baaz [this a])) > > (defrecord foo-bar [] > foo-bar-p > (qux [this] "qux") > (baaz [this a] > (qux this))) > > ============== javascript =============== > bug.foo_bar.prototype.bug$foo_bar_p$qux$arity$1 = function() { > return"qux" > }; > bug.foo_bar.prototype.bug$foo_bar_p$baaz$arity$2 = function(a) { > return a.bug$foo - bar - p$qux$arity$1(a) > };
Thanks for the report: http://dev.clojure.org/jira/browse/CLJS-336 Patch welcome! David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en