Commit a4b103c6 authored by Philipp Marek's avatar Philipp Marek
Browse files

Avoid initializing the same JS variable multiple times.

Example input of

  (ps:ps
    (loop ...
          collect ...
          collect ...))

resulted in

	(function () {
	    var collect41 = [];
	    var collect41 = [];
            ...
parent 52634654
......@@ -268,7 +268,9 @@
((:maximize :maximizing :minimize :minimizing) nil)
((:collect :collecting :append :appending) '[])
((:map :mapping) '{}))))
(push (list 'setf var initial) (prologue state)))
(pushnew (list 'setf var initial)
(prologue state)
:test #'equal))
(loop-case kind
((:sum :summing)`(incf ,var ,item))
((:count :counting)`(when ,item (incf ,var))) ;; note the JS semantics - neither 0 nor "" will count
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment