     prelude = []
     declaration = [
       @makeCode indent
+      @makeCode if @shouldExport then "export " else ""
       @makeCode "class #{name}"
       if @parent then [
         @makeCode( " extends "),

          ]
        [argscode, @makeCode(' => '), bodycode]
      else if @name? and not @bound
        [@makeCode("#{@tab}function "), @name.compileNode(o), argscode, bodycode]
      else if not @bound
        [@makeCode("function"), argscode, bodycode]
      else

        compiledNodes.push node.compileNode o
      else if top
        node.front = true
        if @exportAll then node.match [  # add assignment in here
          M("exported", Class), M("exported", Code)
          new Assign(any, M("exported", Code)).when((a)->a.isCodeDef())
          ({exported}) =>
            exported.shouldExport = yes
        ]
        fragments = node.compileToFragments o
        unless node.isStatement o
          fragments.unshift @makeCode "#{@tab}"
          fragments.push @makeCode ";"
