// bomb out, it's not a binding or a proc
throw runtime.newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)");
}
}
Binding binding = ((RubyBinding)scope).getBinding();
DynamicScope evalScope = binding.getDynamicScope().getEvalScope();
// If no explicit file passed in we will use the bindings location
if (file == null) file = binding.getFrame().getFile();
if (lineNumber == -1) lineNumber = binding.getFrame().getLine();
// FIXME: This determine module is in a strange location and should somehow be in block
evalScope.getStaticScope().determineModule();
Frame lastFrame = context.preEvalWithBinding(binding);
try {
// Binding provided for scope, use it
IRubyObject newSelf = binding.getSelf();
RubyString source = src.convertToString();
Node node = runtime.parseEval(source.getByteList(), file, evalScope, lineNumber);
return node.interpret(runtime, context, newSelf, binding.getFrame().getBlock());
} catch (JumpException.BreakJump bj) {
throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.BREAK, (IRubyObject)bj.getValue(), "unexpected break");
} catch (JumpException.RedoJump rj) {
throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.REDO, (IRubyObject)rj.getValue(), "unexpected redo");
} catch (StackOverflowError sfe) {