Permalink
Browse files

make fn invoke properties reflect how we name (or should name) IFn

protocol properties.
  • Loading branch information...
1 parent 8aa0cd7 commit 9e360428682659f8882ad0e9e0ba804f7a509d32 @swannodette swannodette committed Feb 26, 2013
Showing with 9 additions and 9 deletions.
  1. +7 −7 src/clj/cljs/compiler.clj
  2. +2 −2 src/clj/cljs/core.clj
View
@@ -432,7 +432,7 @@
(emits mname ".cljs$lang$applyTo = ")
(emit-apply-to (assoc f :name name))
(emitln ";")
- (emitln mname ".cljs$lang$arity$variadic = " delegate-name ";")
+ (emitln mname ".cljs$core$IFn$_invoke$arity$variadic = " delegate-name ";")
(emitln "return " mname ";")
(emitln "})()"))))
@@ -483,7 +483,7 @@
(doseq [[n meth] ms]
(if (:variadic meth)
(do (emitln "default:")
- (emitln "return " n ".cljs$lang$arity$variadic("
+ (emitln "return " n ".cljs$core$IFn$_invoke$arity$variadic("
(comma-sep (butlast maxparams))
(when (> (count maxparams) 1) ", ")
"cljs.core.array_seq(arguments, " max-fixed-arity "));"))
@@ -501,8 +501,8 @@
(doseq [[n meth] ms]
(let [c (count (:params meth))]
(if (:variadic meth)
- (emitln mname ".cljs$lang$arity$variadic = " n ".cljs$lang$arity$variadic;")
- (emitln mname ".cljs$lang$arity$" c " = " n ";")))))
+ (emitln mname ".cljs$core$IFn$_invoke$arity$variadic = " n ".cljs$core$IFn$_invoke$arity$variadic;")
+ (emitln mname ".cljs$core$IFn$_invoke$arity$" c " = " n ";")))))
(emitln "return " mname ";")
(emitln "})()")))
(when loop-locals
@@ -623,15 +623,15 @@
;; direct dispatch to variadic case
(and variadic? (> arity mfa))
[(update-in f [:info :name]
- (fn [name] (symbol (str (munge name) ".cljs$lang$arity$variadic"))))
+ (fn [name] (symbol (str (munge name) ".cljs$core$IFn$_invoke$arity$variadic"))))
{:max-fixed-arity mfa}]
;; direct dispatch to specific arity case
:else
(let [arities (map count mps)]
(if (some #{arity} arities)
[(update-in f [:info :name]
- (fn [name] (symbol (str (munge name) ".cljs$lang$arity$" arity)))) nil]
+ (fn [name] (symbol (str (munge name) ".cljs$core$IFn$_invoke$arity$" arity)))) nil]
[f nil]))))
[f nil])]
(emit-wrap env
@@ -658,7 +658,7 @@
:else
(if (and ana/*cljs-static-fns* (= (:op f) :var))
- (let [fprop (str ".cljs$lang$arity$" (count args))]
+ (let [fprop (str ".cljs$core$IFn$_invoke$arity$" (count args))]
(emits "(" f fprop " ? " f fprop "(" (comma-sep args) ") : " f ".call(" (comma-sep (cons "null" args)) "))"))
(emits f ".call(" (comma-sep (cons "null" args)) ")"))))))
View
@@ -1201,8 +1201,8 @@
(defn gen-apply-to-helper
([] (gen-apply-to-helper 1))
([n]
- (let [prop (symbol (core/str "-cljs$lang$arity$" n))
- f (symbol (core/str "cljs$lang$arity$" n))]
+ (let [prop (symbol (core/str "-cljs$core$IFn$_invoke$arity$" n))
+ f (symbol (core/str "cljs$core$IFn$_invoke$arity$" n))]
(if (core/<= n 20)
`(let [~(cs (core/dec n)) (-first ~'args)
~'args (-rest ~'args)]

0 comments on commit 9e36042

Please sign in to comment.