@@ -0,0 +1,964 @@
+package com.redhat.ceylon.compiler.js;%0A%0Aimport com.redhat.ceylon.compiler.typechecker.tree.Tree;%0A%0Apublic class AttributeGenerator %7B%0A%0A    static void getter(final Tree.AttributeGetterDefinition that, GenerateJsVisitor gen) %7B%0A        gen.beginBlock();%0A        gen.initSelf(that.getDeclarationModel(), false);%0A        gen.visitStatements(that.getBlock().getStatements());%0A        gen.endBlock();%0A    %7D%0A%0A    static void setter(final Tree.AttributeSetterDefinition that, GenerateJsVisitor gen) %7B%0A        if (that.getSpecifierExpression() == null) %7B%0A            gen.beginBlock();%0A            gen.initSelf(that.getDeclarationModel(), false);%0A            gen.visitStatements(that.getBlock().getStatements());%0A            gen.endBlock();%0A        %7D else %7B%0A            gen.out(%22%7B%22);%0A            gen.initSelf(that.getDeclarationModel(), true);%0A            gen.out(%22return %22);%0A            that.getSpecifierExpression().visit(gen);%0A            gen.out(%22;%7D%22);%0A        %7D%0A    %7D%0A%0A%7D%0A

refactor code to generate attribute getter/setter