fix inline handle params for cljs, most tests passing
This commit is contained in:
parent
ac8119dbbe
commit
b156727f3c
3 changed files with 9 additions and 6 deletions
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
|
||||
(defn spy [e]
|
||||
(println "SPY:")
|
||||
(println (pr-str e))
|
||||
e)
|
||||
|
||||
|
|
@ -680,8 +681,9 @@
|
|||
#+cljs
|
||||
(defn handle-params [precompiled params-maker possible-params]
|
||||
(let [params (fast-object-array (count params-maker))]
|
||||
(doseq [i params-maker]
|
||||
(aset params i ((get possible-params i))))
|
||||
;;TODO: is there a faster way to do this in cljs?
|
||||
(doseq [i (range (count params-maker))]
|
||||
(aset params i ((get possible-params (get params-maker i)))))
|
||||
(bind-params* precompiled params 0)
|
||||
))
|
||||
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@
|
|||
(mapcat
|
||||
(fn [e]
|
||||
(cond (i/fn-invocation? e)
|
||||
(concat (-> e rest) (ic-possible-params e))
|
||||
(concat (rest e) (ic-possible-params e))
|
||||
|
||||
(vector? e)
|
||||
(ic-possible-params e)
|
||||
|
|
@ -368,6 +368,7 @@
|
|||
used-locals (vec (i/walk-select local-syms vector path))
|
||||
prepared-path (ic-prepare-path local-syms (walk/macroexpand-all (vec path)))
|
||||
possible-params (vec (ic-possible-params path))
|
||||
|
||||
;; TODO: unclear if using long here versus string makes
|
||||
;; a significant difference
|
||||
;; - but using random longs creates possibility of collisions
|
||||
|
|
@ -410,12 +411,12 @@
|
|||
|
||||
~precompiled-sym (.-precompiled info#)
|
||||
~params-maker-sym (.-params-maker info#)]
|
||||
(if (some? ~precompiled-sym)
|
||||
(if (nil? ~precompiled-sym)
|
||||
(i/comp-paths* ~(vec path))
|
||||
(if (nil? ~params-maker-sym)
|
||||
~precompiled-sym
|
||||
~handle-params-code
|
||||
)
|
||||
(i/comp-paths* ~(vec path))
|
||||
))
|
||||
))
|
||||
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@
|
|||
|
||||
(deftest atom-test
|
||||
(let [v (transform s/ATOM inc (atom 1))]
|
||||
(is (instance? clojure.lang.Atom v))
|
||||
(is (instance? #+clj clojure.lang.Atom #+cljs cljs.core/Atom v))
|
||||
(is (= 2 (select-one s/ATOM v) @v))))
|
||||
|
||||
(defspec view-test
|
||||
|
|
|
|||
Loading…
Reference in a new issue