 
                 if param.type
                     checks = true
-                    buffer += "\tif (typeof #{param.name} !== \"#{param.type}\") throw new Error(\"Parameter '#{param.name}' expects to be type '#{param.type}'\");\n"
+                    buffer += "#{@tabString}if (typeof #{param.name} !== \"#{param.type}\") throw new Error(\"Parameter '#{param.name}' expects to be type '#{param.type}'\");\n"
                 if param.instance
                     checks = true
-                    buffer += "\tif (!(#{param.name} instanceof #{param.instance})) throw new Error(\"Parameter '#{param.name}' expects to be instance of '#{param.instance}'\");\n"
+                    buffer += "#{@tabString}if (!(#{param.name} instanceof #{param.instance})) throw new Error(\"Parameter '#{param.name}' expects to be instance of '#{param.instance}'\");\n"
 
 
         if parameters.length > 0 && members

            for param in [0..parameters.length - 1]
                param = parameters[param]
                if param.member
                    buffer += "\tthis.#{param.name} = #{param.name};\n"

        if body.after
            buffer += "\n" if checks || members
            buffer += "#{module.exports.indent(body.after, 1)}"

        buffer += "};"

        return buffer


        cursor = editor.cursors[0]
        text = editor.getSelections()[0].getText()

        @tabString = "\t";
        tabLength = atom.config.get("editor.tabLength")
        if atom.config.get("editor.tabType") == "soft" or atom.config.get("editor.tabType") == "auto"
            @tabString = ""
            i = 0
            while i < 4
                i++
                @tabString += " "


        # Parse classdef to find out what needs to be generated
        classdef = module.exports.parseClassdef(text)

