Project

General

Profile

« Previous | Next » 

Revision 4e40ca30

Added by jeremyevans (Jeremy Evans) over 5 years ago

[ruby/date] Check for numeric arguments in constructors

Previously, the type of these arguments were not checked, leading to
NoMethodErrors in some cases, and TypeErrors in other cases, but not
showing what field was having the problems. This change makes it so
the field with the problem is included in the error message.

For the valid_*? methods, this changes them to return false if one
of the arguments that should be numeric is not.

Fixes Ruby Bug 11935
Fixes Ruby Misc 15298

https://github.com/ruby/date/commit/a2f4b665f8