fix array creation for cljs
This commit is contained in:
parent
41f42e20a1
commit
3073f1256b
2 changed files with 4 additions and 2 deletions
|
|
@ -3,13 +3,13 @@
|
|||
(defn gensyms [amt]
|
||||
(vec (repeatedly amt gensym)))
|
||||
|
||||
(defmacro define-ParamsNeededPath [fn-type invoke-name var-arity-impl]
|
||||
(defmacro define-ParamsNeededPath [clj? fn-type invoke-name var-arity-impl]
|
||||
(let [a (with-meta (gensym "array") {:tag 'objects})
|
||||
impls (for [i (range 21)
|
||||
:let [args (vec (gensyms i))
|
||||
setters (for [j (range i)] `(aset ~a ~j ~(get args j)))]]
|
||||
`(~invoke-name [this# ~@args]
|
||||
(let [~a (com.rpl.specter.impl/fast-object-array ~i)]
|
||||
(let [~a (~(if clj? 'com.rpl.specter.impl/fast-object-array 'object-array) ~i)]
|
||||
~@setters
|
||||
(com.rpl.specter.impl/bind-params* this# ~a 0)
|
||||
)))]
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@
|
|||
|
||||
#+clj
|
||||
(dh/define-ParamsNeededPath
|
||||
true
|
||||
clojure.lang.IFn
|
||||
invoke
|
||||
(applyTo [this args]
|
||||
|
|
@ -100,6 +101,7 @@
|
|||
|
||||
#+cljs
|
||||
(define-ParamsNeededPath
|
||||
false
|
||||
cljs.core/IFn
|
||||
-invoke
|
||||
(-invoke [this p01 p02 p03 p04 p05 p06 p07 p08 p09 p10
|
||||
|
|
|
|||
Loading…
Reference in a new issue