private Frame pushFrameForBlock(Binding binding) { Frame lastFrame = getNextFrame(); Frame bindingFrame = binding.getFrame(); bindingFrame.setVisibility(binding.getVisibility()); pushFrame(bindingFrame); return lastFrame; }
private Frame pushFrameForEval(Binding binding) { Frame lastFrame = getNextFrame(); Frame f = pushFrame(binding.getFrame()); f.setVisibility(binding.getVisibility()); return lastFrame; }
private Frame pushFrameForBlock(Binding binding) { Frame lastFrame = getNextFrame(); Frame bindingFrame = binding.getFrame(); bindingFrame.setVisibility(binding.getVisibility()); pushFrame(bindingFrame); return lastFrame; }
private Frame pushFrameForBlock(Binding binding) { Frame lastFrame = getNextFrame(); Frame f = pushFrame(binding.getFrame()); f.setVisibility(binding.getVisibility()); return lastFrame; }
private Frame pushFrameForEval(Binding binding) { Frame lastFrame = getNextFrame(); Frame f = pushFrame(binding.getFrame()); f.setVisibility(binding.getVisibility()); return lastFrame; }
private Frame pushFrameForBlock(Binding binding) { Frame lastFrame = getNextFrame(); Frame f = pushFrame(binding.getFrame()); f.setVisibility(binding.getVisibility()); return lastFrame; }
public Block cloneBlockAndFrame() { Binding oldBinding = binding; Binding binding = new Binding( oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getKlass(), oldBinding.getDynamicScope(), oldBinding.getBacktrace()); Block newBlock = new Block(body, binding); newBlock.type = type; newBlock.escapeBlock = this; return newBlock; }
public Block cloneBlockAndFrame() { Binding oldBinding = binding; Binding binding = new Binding( oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getKlass(), oldBinding.getDynamicScope(), oldBinding.getBacktrace()); Block newBlock = new Block(body, binding); newBlock.type = type; newBlock.escapeBlock = this; return newBlock; }
public Block cloneBlockAndFrame() { Binding oldBinding = binding; Binding binding = new Binding( oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getDynamicScope(), oldBinding.getMethod(), oldBinding.getFile(), oldBinding.getLine()); Block newBlock = new Block(body, binding); newBlock.type = type; newBlock.escapeBlock = this; return newBlock; }
public Block cloneBlockAndFrame() { Binding oldBinding = binding; Binding binding = new Binding( oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getDynamicScope(), oldBinding.getMethod(), oldBinding.getFile(), oldBinding.getLine()); Block newBlock = new Block(body, binding); newBlock.type = type; newBlock.escapeBlock = this; return newBlock; }
/** * Will yield to the specific block changing the self to be the * current object instead of the self that is part of the frame * saved in the block frame. This method is the basis for the Ruby * instance_eval and module_eval methods. The arguments sent in to * it in the args array will be yielded to the block. This makes * it possible to emulate both instance_eval and instance_exec * with this implementation. */ protected IRubyObject yieldUnder(final ThreadContext context, RubyModule under, Block block) { context.preExecuteUnder(under, block); Visibility savedVisibility = block.getBinding().getVisibility(); block.getBinding().setVisibility(PUBLIC); try { return setupBlock(block).yieldNonArray(context, this, this, context.getRubyClass()); //TODO: Should next and return also catch here? } catch (JumpException.BreakJump bj) { return (IRubyObject) bj.getValue(); } finally { block.getBinding().setVisibility(savedVisibility); context.postExecuteUnder(); } }
/** * Will yield to the specific block changing the self to be the * current object instead of the self that is part of the frame * saved in the block frame. This method is the basis for the Ruby * instance_eval and module_eval methods. The arguments sent in to * it in the args array will be yielded to the block. This makes * it possible to emulate both instance_eval and instance_exec * with this implementation. */ protected IRubyObject yieldUnder(final ThreadContext context, RubyModule under, Block block) { context.preExecuteUnder(under, block); Visibility savedVisibility = block.getBinding().getVisibility(); block.getBinding().setVisibility(PUBLIC); try { return setupBlock(block).yieldNonArray(context, this, this, context.getRubyClass()); //TODO: Should next and return also catch here? } catch (JumpException.BreakJump bj) { return (IRubyObject) bj.getValue(); } finally { block.getBinding().setVisibility(savedVisibility); context.postExecuteUnder(); } }
/** * Will yield to the specific block changing the self to be the * current object instead of the self that is part of the frame * saved in the block frame. This method is the basis for the Ruby * instance_eval and module_eval methods. The arguments sent in to * it in the args array will be yielded to the block. This makes * it possible to emulate both instance_eval and instance_exec * with this implementation. */ protected IRubyObject yieldUnder(final ThreadContext context, RubyModule under, IRubyObject[] args, Block block) { context.preExecuteUnder(under, block); Visibility savedVisibility = block.getBinding().getVisibility(); block.getBinding().setVisibility(PUBLIC); try { if (args.length == 1) { IRubyObject valueInYield = args[0]; return setupBlock(block).yieldNonArray(context, valueInYield, this, context.getRubyClass()); } else { IRubyObject valueInYield = RubyArray.newArrayNoCopy(context.runtime, args); return setupBlock(block).yieldArray(context, valueInYield, this, context.getRubyClass()); } //TODO: Should next and return also catch here? } catch (JumpException.BreakJump bj) { return (IRubyObject) bj.getValue(); } finally { block.getBinding().setVisibility(savedVisibility); context.postExecuteUnder(); } }
/** * Will yield to the specific block changing the self to be the * current object instead of the self that is part of the frame * saved in the block frame. This method is the basis for the Ruby * instance_eval and module_eval methods. The arguments sent in to * it in the args array will be yielded to the block. This makes * it possible to emulate both instance_eval and instance_exec * with this implementation. */ protected IRubyObject yieldUnder(final ThreadContext context, RubyModule under, IRubyObject[] args, Block block) { context.preExecuteUnder(under, block); Visibility savedVisibility = block.getBinding().getVisibility(); block.getBinding().setVisibility(PUBLIC); try { if (args.length == 1) { IRubyObject valueInYield = args[0]; return setupBlock(block).yieldNonArray(context, valueInYield, this, context.getRubyClass()); } else { IRubyObject valueInYield = RubyArray.newArrayNoCopy(context.runtime, args); return setupBlock(block).yieldArray(context, valueInYield, this, context.getRubyClass()); } //TODO: Should next and return also catch here? } catch (JumpException.BreakJump bj) { return (IRubyObject) bj.getValue(); } finally { block.getBinding().setVisibility(savedVisibility); context.postExecuteUnder(); } }
/** * Will yield to the specific block changing the self to be the * current object instead of the self that is part of the frame * saved in the block frame. This method is the basis for the Ruby * instance_eval and module_eval methods. The arguments sent in to * it in the args array will be yielded to the block. This makes * it possible to emulate both instance_eval and instance_exec * with this implementation. */ protected IRubyObject yieldUnder(final ThreadContext context, RubyModule under, IRubyObject[] args, Block block, EvalType evalType) { context.preExecuteUnder(this, under, block); IRubyObject savedBindingSelf = block.getBinding().getSelf(); IRubyObject savedFrameSelf = block.getBinding().getFrame().getSelf(); Visibility savedVisibility = block.getBinding().getVisibility(); block.getBinding().setVisibility(PUBLIC); try { if (args.length == 1) { IRubyObject valueInYield = args[0]; return setupBlock(block, evalType).yieldNonArray(context, valueInYield, this); // context.getRubyClass()); } else { IRubyObject valueInYield = RubyArray.newArrayMayCopy(context.runtime, args); return setupBlock(block, evalType).yieldArray(context, valueInYield, this); // context.getRubyClass()); } } finally { block.getBinding().setVisibility(savedVisibility); block.getBinding().setSelf(savedBindingSelf); block.getBinding().getFrame().setSelf(savedFrameSelf); context.postExecuteUnder(); } }
/** * Will yield to the specific block changing the self to be the * current object instead of the self that is part of the frame * saved in the block frame. This method is the basis for the Ruby * instance_eval and module_eval methods. The arguments sent in to * it in the args array will be yielded to the block. This makes * it possible to emulate both instance_eval and instance_exec * with this implementation. */ protected IRubyObject yieldUnder(final ThreadContext context, RubyModule under, IRubyObject[] args, Block block, EvalType evalType) { context.preExecuteUnder(this, under, block); IRubyObject savedBindingSelf = block.getBinding().getSelf(); IRubyObject savedFrameSelf = block.getBinding().getFrame().getSelf(); Visibility savedVisibility = block.getBinding().getVisibility(); block.getBinding().setVisibility(PUBLIC); try { if (args.length == 1) { IRubyObject valueInYield = args[0]; return setupBlock(block, evalType).yieldNonArray(context, valueInYield, this); // context.getRubyClass()); } else { IRubyObject valueInYield = RubyArray.newArrayMayCopy(context.runtime, args); return setupBlock(block, evalType).yieldArray(context, valueInYield, this); // context.getRubyClass()); } } finally { block.getBinding().setVisibility(savedVisibility); block.getBinding().setSelf(savedBindingSelf); block.getBinding().getFrame().setSelf(savedFrameSelf); context.postExecuteUnder(); } }
oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getDynamicScope(), oldBinding.getMethod(),
oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getDynamicScope(), oldBinding.getMethod(),
oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getKlass(), oldBinding.getDynamicScope(),
oldBinding.getSelf(), oldBinding.getFrame().duplicate(), oldBinding.getVisibility(), oldBinding.getKlass(), oldBinding.getDynamicScope(),