diff options
author | Chouser <chouser@n01se.net> | 2008-09-23 23:51:37 +0000 |
---|---|---|
committer | Chouser <chouser@n01se.net> | 2008-09-23 23:51:37 +0000 |
commit | 2d10026e88a8e1a70189889beb0cf3c0a372f637 (patch) | |
tree | 3d739ae89d0caf123696d3ecf709f259d8661ed7 /clojurescript/tojs.clj | |
parent | 442d95e129e58eaecf76f4db583ad81c510cfad1 (diff) |
ClojureScript: Chrome doesn't set function.arity: changed lazy apply so it doesn't rely on arity.
Diffstat (limited to 'clojurescript/tojs.clj')
-rw-r--r-- | clojurescript/tojs.clj | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clojurescript/tojs.clj b/clojurescript/tojs.clj index 4bf23d39..7c7f6fea 100644 --- a/clojurescript/tojs.clj +++ b/clojurescript/tojs.clj @@ -58,7 +58,7 @@ manym (< 1 (count (.methods e))) newctx (assoc ctx :fnname (.thisName e))] (vstr [(when (.variadicMethod e) - "clojure.JS.variatic") + ["clojure.JS.variatic(" (count (.reqParms maxm)) ","]) "(function" (when *debug-fn-names* [" __" (.replaceAll (.name e) "[\\W_]+" "_")]) @@ -73,7 +73,10 @@ (fnmethod fm maxm newctx)])) "}"]) "\n" - (fnmethod maxm maxm newctx) "})"]))) + (fnmethod maxm maxm newctx) "})" + (when (.variadicMethod e) + ")") + ]))) (defmethod tojs clojure.lang.Compiler$BodyExpr [e ctx] (apply str (interpose ",\n" (map #(tojs % ctx) (.exprs e))))) |