ClojureScript

Concat throws exceptions with string arguments

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    r1909 (works in r1896)

Description

When a string is in one of the arguments to concat, it throws an exception complaining that the string does not implement -seq. (This happens with one or two arguments, although the exception is raised in a different place.)

ClojureScript:cljs.user> (concat "a" "b") 
"Error evaluating:" (concat "a" "b") :as "cljs.core.concat.call(null,\"a\",\"b\")"
org.mozilla.javascript.JavaScriptException: Error: No protocol method ISeqable.-seq defined for type string: b (cljs/core.cljs#289)
	at cljs/core.cljs:289 (anonymous)
	at cljs/core.cljs:283 (_seq)
	at cljs/core.cljs:2135 (anonymous)
	at cljs/core.cljs:281 (_seq)
	at cljs/core.cljs:1981 (anonymous)
	at cljs/core.cljs:228 (_next)
	at cljs/core.cljs:2094 (anonymous)
	at cljs/core.cljs:228 (_next)
	at cljs/core.cljs:492 (next)
	at cljs/core.cljs:6582 (pr_sequential_writer)
	at cljs/core.cljs:6790 (anonymous)
	at cljs/core.cljs:306 (_pr_writer)
	at cljs/core.cljs:6680 (pr_writer)
	at cljs/core.cljs:6678 (pr_seq_writer)
	at cljs/core.cljs:6684 (pr_sb_with_opts)
	at cljs/core.cljs:6698 (pr_str_with_opts)
	at cljs/core.cljs:6724 (anonymous)
	at cljs/core.cljs:6729 (anonymous)
	at <cljs repl>:4

ClojureScript:cljs.user> (concat "a")
"Error evaluating:" (concat "a") :as "cljs.core.concat.call(null,\"a\")"
org.mozilla.javascript.JavaScriptException: Error: No protocol method ISeqable.-seq defined for type string: a (cljs/core.cljs#289)
	at cljs/core.cljs:289 (anonymous)
	at cljs/core.cljs:283 (_seq)
	at cljs/core.cljs:2135 (anonymous)
	at cljs/core.cljs:281 (_seq)
	at cljs/core.cljs:446 (seq)
	at cljs/core.cljs:6578 (pr_sequential_writer)
	at cljs/core.cljs:6790 (anonymous)
	at cljs/core.cljs:306 (_pr_writer)
	at cljs/core.cljs:6680 (pr_writer)
	at cljs/core.cljs:6678 (pr_seq_writer)
	at cljs/core.cljs:6684 (pr_sb_with_opts)
	at cljs/core.cljs:6698 (pr_str_with_opts)
	at cljs/core.cljs:6724 (anonymous)
	at cljs/core.cljs:6729 (anonymous)
	at <cljs repl>:5

Here's a stacktrace that removes the print machinery from the equation:

ClojureScript:cljs.user> (doall (concat "a"))
"Error evaluating:" (doall (concat "a")) :as "cljs.core.doall.call(null,cljs.core.concat.call(null,\"a\"))"
org.mozilla.javascript.JavaScriptException: Error: No protocol method ISeqable.-seq defined for type string: a (cljs/core.cljs#289)
	at cljs/core.cljs:289 (anonymous)
	at cljs/core.cljs:283 (_seq)
	at cljs/core.cljs:2135 (anonymous)
	at cljs/core.cljs:281 (_seq)
	at cljs/core.cljs:446 (seq)
	at cljs/core.cljs:6517 (anonymous)
	at cljs/core.cljs:6552 (anonymous)
	at cljs/core.cljs:6530 (anonymous)
	at cljs/core.cljs:6539 (anonymous)
	at <cljs repl>:3 (anonymous)
	at <cljs repl>:3

Activity

David Nolen made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: