                                 create_intrinsic "setGlobal", [lhs, new_rhs]
                 else
                         n.left = @visit n.left
+                        n.right = new_rhs
                         n
                         
 

                for property in n.properties
                        property.value = @visit property.value
                n
                
        visitAssignmentExpression: (n) ->
                lhs = n.left
                rhs = @visit n.right

# 2) adds mappings for all .closed variables
class SubstituteVariables extends TreeTransformer
        constructor: (module) ->
                @function_stack = new Stack
                @mappings = new Stack
                super

        currentMapping: -> if @mappings.depth > 0 then @mappings.top else Object.create null

