public Binding(Frame frame, DynamicScope dynamicScope, String method, String filename, int line) { assert frame != null; this.self = frame.getSelf(); this.frame = frame; this.visibility = frame.getVisibility(); this.dynamicScope = dynamicScope; this.method = method; this.filename = filename; this.line = line; }
@Deprecated public Binding(Frame frame, DynamicScope dynamicScope, BacktraceElement backtrace) { this.self = frame.getSelf(); this.frame = frame; this.visibility = frame.getVisibility(); this.dynamicScope = dynamicScope; this.method = backtrace.method; this.filename = backtrace.filename; this.line = backtrace.line; }
public Visibility getCurrentVisibility() { return getCurrentFrame().getVisibility(); }
@Deprecated public Binding(Frame frame, DynamicScope dynamicScope, BacktraceElement backtrace) { this.self = frame.getSelf(); this.frame = frame; this.visibility = frame.getVisibility(); this.dynamicScope = dynamicScope; this.method = backtrace.method; this.filename = backtrace.filename; this.line = backtrace.line; }
public Binding(Frame frame, DynamicScope dynamicScope, String method, String filename, int line) { assert frame != null; this.self = frame.getSelf(); this.frame = frame; this.visibility = frame.getVisibility(); this.dynamicScope = dynamicScope; this.method = method; this.filename = filename; this.line = line; }
public Binding(Frame frame, RubyModule bindingClass, DynamicScope dynamicScope, BacktraceElement backtrace) { this.self = frame.getSelf(); this.frame = frame; this.visibility = frame.getVisibility(); this.klass = bindingClass; this.dynamicScope = dynamicScope; this.backtrace = backtrace; }
/** * Return a binding representing the previous call's state but with a specified self * @param self the self object to use * @return the current binding, using the specified self */ @Deprecated public Binding previousBinding(IRubyObject self) { Frame frame = getPreviousFrame(); return new Binding(self, frame, frame.getVisibility(), getPreviousRubyClass(), getCurrentScope(), backtrace[backtraceIndex].clone()); }
/** * Return a binding representing the previous call's state but with a specified self * @param self the self object to use * @return the current binding, using the specified self */ @Deprecated public Binding previousBinding(IRubyObject self) { Frame frame = getPreviousFrame(); return new Binding(self, frame, frame.getVisibility(), getPreviousRubyClass(), getCurrentScope(), backtrace[backtraceIndex].clone()); }
/** * Return a binding representing the current call's state but with the * specified scope and self. * @param self the self object to use * @param scope the scope to use * @return the current binding using the specified self and scope */ public Binding currentBinding(IRubyObject self, DynamicScope scope) { Frame frame = getCurrentFrame().capture(); return new Binding(self, frame, frame.getVisibility(), getRubyClass(), scope, backtrace[backtraceIndex].clone()); }
/** * Return a binding representing the current call's state but with the * specified scope and self. * @param self the self object to use * @param scope the scope to use * @return the current binding using the specified self and scope */ public Binding currentBinding(IRubyObject self, DynamicScope scope) { Frame frame = getCurrentFrame().capture(); return new Binding(self, frame, frame.getVisibility(), getRubyClass(), scope, backtrace[backtraceIndex].clone()); }
/** * Return a binding representing the current call's state but with a specified self * @param self the self object to use * @return the current binding, using the specified self */ public Binding currentBinding(IRubyObject self) { Frame frame = getCurrentFrame().capture(); return new Binding(self, frame, frame.getVisibility(), getRubyClass(), getCurrentScope(), backtrace[backtraceIndex].clone()); }
/** * Return a binding representing the current call's state but with the * specified scope and self. * @param self the self object to use * @param scope the scope to use * @return the current binding using the specified self and scope */ public Binding currentBinding(IRubyObject self, DynamicScope scope) { Frame frame = getCurrentFrame().capture(); BacktraceElement elt = backtrace[backtraceIndex]; return new Binding(self, frame, frame.getVisibility(), scope, elt.getMethod(), elt.getFilename(), elt.getLine()); }
/** * Return a binding representing the current call's state but with the * specified scope and self. * @param self the self object to use * @param scope the scope to use * @return the current binding using the specified self and scope */ public Binding currentBinding(IRubyObject self, DynamicScope scope) { Frame frame = getCurrentFrame().capture(); BacktraceElement elt = backtrace[backtraceIndex]; return new Binding(self, frame, frame.getVisibility(), scope, elt.getMethod(), elt.getFilename(), elt.getLine()); }
/** * Return a binding representing the current call's state but with a specified self * @param self the self object to use * @return the current binding, using the specified self */ public Binding currentBinding(IRubyObject self) { Frame frame = getCurrentFrame().capture(); return new Binding(self, frame, frame.getVisibility(), getRubyClass(), getCurrentScope(), backtrace[backtraceIndex].clone()); }
/** * Return a binding representing the current call's state but with a specified self * @param self the self object to use * @return the current binding, using the specified self */ public Binding currentBinding(IRubyObject self) { Frame frame = getCurrentFrame().capture(); BacktraceElement elt = backtrace[backtraceIndex]; return new Binding(self, frame, frame.getVisibility(), getCurrentScope(), elt.getMethod(), elt.getFilename(), elt.getLine()); }
public IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type) { IRubyObject self = prepareSelf(binding); Visibility oldVis = binding.getFrame().getVisibility(); Frame lastFrame = pre(context, null, binding); try { setupBlockArg(context, value, self, Block.NULL_BLOCK, type); return evalBlockBody(context, binding, self); } catch (JumpException.NextJump nj) { return handleNextJump(context, nj, type); } finally { post(context, binding, oldVis, lastFrame); } }
/** * Return a binding representing the current call's state but with a specified self * @param self the self object to use * @return the current binding, using the specified self */ public Binding currentBinding(IRubyObject self) { Frame frame = getCurrentFrame().capture(); BacktraceElement elt = backtrace[backtraceIndex]; return new Binding(self, frame, frame.getVisibility(), getCurrentScope(), elt.getMethod(), elt.getFilename(), elt.getLine()); }
public void preExecuteUnder(IRubyObject executeUnderObj, RubyModule executeUnderClass, Block block) { Frame frame = getCurrentFrame(); DynamicScope scope = getCurrentScope(); StaticScope sScope = runtime.getStaticScopeFactory().newBlockScope(scope.getStaticScope()); sScope.setModule(executeUnderClass); pushScope(DynamicScope.newDynamicScope(sScope, scope)); pushCallFrame(frame.getKlazz(), frame.getName(), executeUnderObj, block); getCurrentFrame().setVisibility(getPreviousFrame().getVisibility()); }
public void preExecuteUnder(IRubyObject executeUnderObj, RubyModule executeUnderClass, Block block) { Frame frame = getCurrentFrame(); DynamicScope scope = getCurrentScope(); StaticScope sScope = runtime.getStaticScopeFactory().newBlockScope(scope.getStaticScope()); sScope.setModule(executeUnderClass); pushScope(DynamicScope.newDynamicScope(sScope, scope)); pushCallFrame(frame.getKlazz(), frame.getName(), executeUnderObj, block); getCurrentFrame().setVisibility(getPreviousFrame().getVisibility()); }
public void preExecuteUnder(RubyModule executeUnderClass, Block block) { Frame frame = getCurrentFrame(); pushRubyClass(executeUnderClass); DynamicScope scope = getCurrentScope(); StaticScope sScope = runtime.getStaticScopeFactory().newBlockScope(scope.getStaticScope()); sScope.setModule(executeUnderClass); pushScope(DynamicScope.newDynamicScope(sScope, scope)); pushCallFrame(frame.getKlazz(), frame.getName(), frame.getSelf(), block); getCurrentFrame().setVisibility(getPreviousFrame().getVisibility()); }