Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make Time#utc and #localtime raise RuntimeError when the object is frozen #4657
This is a fix for #4655 that replicates the MRI behaviour of frozen
It adds three tests to
The actual fix is very simple, in
There are two additional public methods that mutate
They also seem to be duplicates of each other, an neither has been touched in 10 years.
Should they be changed to throw the same error, or how is frozen-ness handled when objects are changed from Java code?
referenced this pull request
Jun 8, 2017
Generally, if we are doing behavior for which MRI errors, I'm not worried about fixing it. The truth is that all Ruby code is MRI code first and if they're not hitting the errors they're pretty much guaranteed not to have a problem with this change on JRuby. Of course there's plenty of JRuby-specific code out there but I doubt much of it is freezing and then calling mutative methods on Time objects.
I'll review and merge if @enebo has no concerns.