Browse files

CLJS-641: js* overflow for large inputs

sequence construction not wrapped in a lazy-seq, would result in a stack
overflow for large inputs
  • Loading branch information...
1 parent ae1b851 commit 819fb475dd7efa11fe9f3d6136373c8b95309dbd @swannodette swannodette committed Oct 29, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/clj/cljs/analyzer.clj
5 src/clj/cljs/analyzer.clj
@@ -937,7 +937,10 @@
(list s)
(let [end (.indexOf s "}" idx)
inner (:name (resolve-existing-var env (symbol (subs s (+ 2 idx) end))))]
- (cons (subs s 0 idx) (cons inner (interp (subs s (inc end)))))))))]
+ (lazy-seq
+ (cons (subs s 0 idx)
+ (cons inner
+ (interp (subs s (inc end))))))))))]
{:env env :op :js :form form :code (apply str (interp jsform))
:tag (-> form meta :tag) :js-op (-> form meta :js-op)})))

0 comments on commit 819fb47

Please sign in to comment.