                         declarations: [{
                                 type: VariableDeclarator,
                                 id:   import_tmp
-                                init: create_intrinsic(moduleGet_id, [n.source])
+                                init: create_intrinsic(moduleGet_id, [n.source_path])
                         }],
                         kind: "let"
                 }

                                        }

                                        @exports.push { name: spec.name, id: spectmp }
                        console.log escodegen.generate export_decl
                        return export_decl

                # export function foo () { ... }
                if n.declaration.type is FunctionDeclaration
                        @exports.push { id: n.declaration.id }
                        return n.declaration

                # export let foo = bar;
                if n.declaration.type is VariableDeclaration
                        @exports.push({ id: decl.id }) for decl in n.declaration.declarations
                        return n.declaration

                # export foo = bar;
                if n.declaration.type is VariableDeclarator
                        @exports.push { id: n.declaration.id }
                        return n.declaration

                # export default = ...;
                # 
                if n.default
                        default_id = create_identifier "default"
                        @exports.push { id: default_id }
                        return {
                                type: VariableDeclaration,
                                declarations: [{
                                        type: VariableDeclarator,
                                        id:   default_id
                                        init: n.declaration
                                }],
                                kind: "var"
                        }

                throw new Error("Unsupported type of export declaration #{n.declaration.type}")

        visitModuleDeclaration: (n) ->
                init = 
                        type:     MemberExpression
                        object:   create_intrinsic(moduleGet_id, [n.source])
                        property: create_identifier "default"
                        computed: false

                return {
                        type: VariableDeclaration,
                        declarations: [{

                throw new Error("internal compiler error, only form \"import blah from 'blah'\" supported") if specifiers.length isnt 1
                specifiers[0].id

        define_export_property = (exported_id, local_id = exported_id) ->
                console.log "exporting #{local_id.name} as #{exported_id.name}"
                exports_id = create_identifier("exports") # XXX as with compiler.coffee, this 'exports' should be '%exports' if the module has ES6 module declarations

                Object_defineProperty = {
                        type: MemberExpression,
                        computed: false,
                        object: create_identifier("Object"),
                        property: create_identifier("defineProperty")
                }

                getter = {
                        type: FunctionExpression,
                        params: [],
                        defaults: [],
                        body:
                                type: BlockStatement
                                body: [
                                        { type: ReturnStatement, argument: local_id }
                                ]
                }
                        
                property_literal = {
                        type: ObjectExpression,
                        properties: [
                                { type: Property, kind: "init", key: create_identifier("get"), value: getter }
                        ]
                }

                return {
                        type: ExpressionStatement,
                        expression: {
                                type: CallExpression
                                callee: Object_defineProperty,
                                arguments: [
                                        exports_id,
                                        create_string_literal(exported_id.name),
                                        property_literal
                                ]
                        }
                }
                
                
        visitFunction: (n) ->
                return n if not n.toplevel
                
                @exports = []
                @batch_exports = []

                super
                
        visitImportDeclaration: (n) ->
                if n.specifiers.length is 0
                        # no specifiers, it's of the form:  import from "foo"
                        # don't waste a decl for this type
                        return create_intrinsic(moduleGet_id, [n.source_path])

                # otherwise create a fresh declaration for the module object
                # 
