fasterthanlime / shin

:warning: (def shin (dissoc clojurescript :jvm :google_closure)) (deprecated)
MIT License
35 stars 1 forks source link

Have all calls use `.call` #29

Closed fasterthanlime closed 9 years ago

fasterthanlime commented 9 years ago

So that IFn(s) can seemingly be callable too.

See this sample mainline cljs input:

(let [m {:a "Hello"}]
  (prn (:a m))
  (prn (m :a)))

And output:

// Compiled by ClojureScript 0.0-2156
var m_4766 = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "a", "a", 1013904339), "Hello"], null);
cljs.core.prn.call(null, new cljs.core.Keyword(null, "a", "a", 1013904339).cljs$core$IFn$_invoke$arity$1(m_4766));
cljs.core.prn.call(null, m_4766.call(null, new cljs.core.Keyword(null, "a", "a", 1013904339)));

That's quite smart!

fasterthanlime commented 9 years ago

Also, get rid of the __proto__ hack in collections, so that shin-compiled code works in IE9+

fasterthanlime commented 9 years ago

That means shin-compiled code should work in IE now :)