private Frame pushFrameForEval(Binding binding) { Frame lastFrame = getNextFrame(); Frame f = pushFrame(binding.getFrame()); setFileAndLine(binding.getFile(), binding.getLine()); f.setVisibility(binding.getVisibility()); return lastFrame; }
private Frame pushFrameForBlock(Binding binding) { Frame lastFrame = getNextFrame(); Frame f = pushFrame(binding.getFrame()); // set the binding's frame's "previous" file and line to current, so // trace will show who called the block f.setFileAndLine(file, line); setFileAndLine(binding.getFile(), binding.getLine()); f.setVisibility(binding.getVisibility()); return lastFrame; }
public static Block createMethodBlock( ThreadContext context, IRubyObject self, DynamicScope dynamicScope, MethodBlock body) { RubyMethod method = body.method; RubyModule module = method.getMethod().getImplementationClass(); Frame frame = new Frame(); frame.setKlazz(module); frame.setName(method.getMethodName()); frame.setSelf(method.receiver(context)); frame.setVisibility(method.getMethod().getVisibility()); Binding binding = new Binding( frame, dynamicScope, new BacktraceElement(method.getMethodName(), body.getFile(), body.getLine())); return new Block(body, binding); }