Closed thedavidmeister closed 6 years ago
actually, that's not the exact error, but it was a range error
Can you provide a failing example please.
@niwinz, any news on that issue? In case you still need failing case here it is:
(require '[cuerdas.core :as str])
(str/pad "12345" {:length 4 :padding "0"})
;; On JVM it prints "12345" but on JS it throws with following message
;; #object[RangeError RangeError: Invalid count value]
;; Function.cuerdas.core.repeat.cljs$core$IFn$_invoke$arity$2 (jar:file:/home/mt0erfztxt/.m2/repository/funcool/cuerdas/2.0.3/cuerdas-2.0.3.jar!/cuerdas/core.cljc:305:16)
;; cuerdas.core/repeat (jar:file:/home/mt0erfztxt/.m2/repository/funcool/cuerdas/2.0.3/cuerdas-2.0.3.jar!/cuerdas/core.cljc:299:1)
;; Function.cuerdas.core.pad.cljs$core$IFn$_invoke$arity$variadic (jar:file:/home/mt0erfztxt/.m2/repository/funcool/cuerdas/2.0.3/cuerdas-2.0.3.jar!/cuerdas/core.cljc:691:22)
;; cuerdas$core$pad (jar:file:/home/mt0erfztxt/.m2/repository/funcool/cuerdas/2.0.3/cuerdas-2.0.3.jar!/cuerdas/core.cljc:677:1)
i'm seeing this when length is smaller than the string for
pad
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Resulting_string_too_large