                         assignments = []
                         for i in [0...n.declarations.length]
                                 if n.declarations[i].init?
-                                        assignments.push
-                                                type: syntax.ExpressionStatement
-                                                expression:
-                                                        type: syntax.AssignmentExpression
-                                                        left: create_identifier n.declarations[i].id.name
-                                                        right: n.declarations[i].init
-                                                        operator: "="
+                                        assignment =
+                                                type: syntax.AssignmentExpression
+                                                left: create_identifier n.declarations[i].id.name
+                                                right: n.declarations[i].init
+                                                operator: "="
+
+                                        if @skipExpressionStatement
+                                                assignments.push assignment
+                                        else
+                                                assignments.push
+                                                        type: syntax.ExpressionStatement
+                                                        expression: assignment
 
                         # now return the new assignments, which will replace the original variable
                         # declaration node.
                         if assignments.length == 1
                                 return assignments[0]
 
-                        return {
-                                type: syntax.BlockStatement
-                                body: assignments
-                        }
+                        if @skipExpressionStatement
+                                return {
+                                        type: syntax.SequenceExpression
+                                        expressions: assignments
+                                }
+                        else
+                                return {
+                                        type: syntax.BlockStatement
+                                        body: assignments
+                                }
                 n
 
 # this class really doesn't behave like a normal NodeVisitor, as it modifies the tree in-place

                for decl in n.declarations
                        decl.init = @visit decl.init
                        if @currentMapping().hasOwnProperty decl.id.name
                                rv.push {
                                        type: syntax.ExpressionStatement
                                        expression:
                                                type: syntax.AssignmentExpression,
                                                operator: "="
                                                left:
                                                        type: syntax.CallExpression
                                                        callee: create_identifier "%slot"
                                                        arguments: [ @currentMapping()["%env"], (create_number_literal @currentMapping()["%slot_mapping"][decl.id.name]) ]
                                                right: decl.init || { type: syntax.Identifier, name: "undefined" }
                                        
                                }
                        else
                                rv.push {
                                        type: syntax.VariableDeclaration

                # if any of the variables declared in n.init are closed over
                # we promote all of them outside of n.init.

                @skipExpressionStatement = true
                init = @visit n.init
                @skipExpressionStatement = false
                n.test = @visit n.test
                n.update = @visit n.update
                n.body = @visit n.body
