New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer hide exceptions from coerce method #5025

Merged
merged 3 commits into from Feb 1, 2018

Conversation

Projects
None yet
3 participants
@nomadium
Contributor

nomadium commented Jan 31, 2018

Hi folks,

This is another feature targeting Ruby 2.5 [1]:

  • Numerical comparison operators (< ,<=, >=, >) no longer rescue exceptions of #coerce. Return nil in #coerce if the coercion is impossible.

  • Integer#step does no longer rescue exceptions when given a step value which cannot be compared with #> to 0.

  • Range#initialize no longer rescue exceptions when comparing begin and end with #<=> and raise a "bad value for range" ArgumentError but instead let the exception from the #<=> call go through.

All of these from feature #7688 [2].

Note: The tests are copied from MRI.

Thanks for your review and feedback.

  1. #4876
  2. https://bugs.ruby-lang.org/issues/7688

nomadium added some commits Jan 31, 2018

No longer rescue exceptions of #coerce for Numerical comparison opera…
…tors (< ,<=, >=, >)

For more information, please see feature #7688.
No longer rescue exceptions from Integer#step when given a step value…
… which cannot be compared with #> to 0

For more information, please see feature #7688.

@enebo enebo added this to the JRuby 9.3.0.0 milestone Feb 1, 2018

@enebo enebo merged commit ec40e44 into jruby:ruby-2.5 Feb 1, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details

@nomadium nomadium deleted the nomadium:no-longer-hide-exceptions-from-coerce-method branch Feb 1, 2018

@enebo enebo modified the milestones: JRuby 9.3.0.0, JRuby 9.2.0.0 Apr 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment