public MethodDefinitionNode compileClassNode( SourceSection sourceSection, String name, org.jruby.ast.Node bodyNode) { environment.addMethodDeclarationSlots(); RubyNode body; if (bodyNode != null) { parentSourceSection = sourceSection; try { body = bodyNode.accept(this); } finally { parentSourceSection = null; } } else { body = new ObjectLiteralNode(context, sourceSection, context.getCoreLibrary().getNilObject()); } if (environment.getFlipFlopStates().size() > 0) { body = SequenceNode.sequence(context, sourceSection, initFlipFlopStates(sourceSection), body); } body = new CatchReturnPlaceholderNode(context, sourceSection, body, environment.getReturnID()); final RubyRootNode rootNode = new RubyRootNode( context, sourceSection, environment.getFrameDescriptor(), environment.getSharedMethodInfo(), body); return new MethodDefinitionNode( context, sourceSection, environment.getSharedMethodInfo().getName(), environment.getSharedMethodInfo(), environment.needsDeclarationFrame(), rootNode, false); }