<< Back to previous view

[CLJS-600] Concat throws exceptions with string arguments Created: 30/Sep/13  Updated: 04/Oct/13  Resolved: 04/Oct/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Francis Avila Assignee: Unassigned
Resolution: Completed Votes: 0
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


 Comments   
Comment by David Nolen [ 04/Oct/13 8:42 PM ]

fixed http://github.com/clojure/clojurescript/commit/73aa7ef0dd75e960538d53e1423d7023dd568efb

Generated at Mon Oct 20 16:43:18 CDT 2014 using JIRA 4.4#649-r158309.