Skip to content

Commit

Permalink
Range no longer rescues exceptions during init <=> call. #4876
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Mar 27, 2018
1 parent 2e850a5 commit 9802921
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/src/main/java/org/jruby/RubyRange.java
Expand Up @@ -256,12 +256,8 @@ final int[] begLenInt(int len, int err) {

private void init(ThreadContext context, IRubyObject begin, IRubyObject end, boolean isExclusive) {
if (!(begin instanceof RubyFixnum && end instanceof RubyFixnum)) {
try {
IRubyObject result = invokedynamic(context, begin, MethodNames.OP_CMP, end);
if (result.isNil()) {
throw context.runtime.newArgumentError("bad value for range");
}
} catch (RaiseException re) {
IRubyObject result = invokedynamic(context, begin, MethodNames.OP_CMP, end);
if (result.isNil()) {
throw context.runtime.newArgumentError("bad value for range");
}
}
Expand Down

0 comments on commit 9802921

Please sign in to comment.