File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 906906 (emitln " return " n " .call(this" (if (zero? pcnt) nil
907907 (list " ," (comma-sep (take pcnt maxparams)))) " );" ))))
908908 (emitln " }" )
909- (emitln " throw(new Error('Invalid arity: ' + (arguments.length - 1)));" )
909+ (let [arg-count-js (if (= 'self__ (-> ms first val :params first :name ))
910+ " (arguments.length - 1)"
911+ " arguments.length" )]
912+ (emitln " throw(new Error('Invalid arity: ' + " arg-count-js " ));" ))
910913 (emitln " };" )
911914 (when variadic
912915 (emitln mname " .cljs$lang$maxFixedArity = " max-fixed-arity " ;" )
Original file line number Diff line number Diff line change 15371537 ; ; Make sure we didn't delete the alpha? fn
15381538 (is (some? alpha-2585?)))
15391539
1540+ (defn fn-2741* ([x]) ([x y]))
1541+ (def fn-2741 fn-2741* )
1542+
1543+ (deftest test-cljs-2741
1544+ (is (thrown-with-msg? js/Error #".*Invalid arity: 0" ((fn ([x]) ([x y])))))
1545+ (is (thrown-with-msg? js/Error #".*Invalid arity: 3" ((fn ([x]) ([x y])) 1 2 3 )))
1546+ (is (thrown-with-msg? js/Error #".*Invalid arity: 0" (fn-2741 )))
1547+ (is (thrown-with-msg? js/Error #".*Invalid arity: 3" (fn-2741 1 2 3 )))
1548+ (is (thrown-with-msg? js/Error #".*Invalid arity: 0" ({})))
1549+ (is (thrown-with-msg? js/Error #".*Invalid arity: 3" ({} 1 2 3 ))))
1550+
15401551(comment
15411552 ; ; ObjMap
15421553 ; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments