Project

General

Profile

Backport #5270

Date#freeze causes memoized Date methods to fail

Added by ddfreyne (Denis Defreyne) about 8 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:39244]

Description

When freezing a Date object, memoized methods will fail because the memoized value cannot be stored on the frozen object. This is because memoized values are stored as instance variables on the object, and those are immutable for frozen objects.

Attached to this bug report is a test case, as well as a patch that fixes the issue (and also includes the test case).


Files

date-once-testcase.rb (205 Bytes) date-once-testcase.rb ddfreyne (Denis Defreyne), 09/03/2011 05:12 PM
date-once.patch (1.7 KB) date-once.patch Patch that fixes the issue ddfreyne (Denis Defreyne), 09/03/2011 05:13 PM

History

Updated by ddfreyne (Denis Defreyne) about 8 years ago

Forgot to attach the patch.

#2

Updated by jeremyevans0 (Jeremy Evans) 3 months ago

  • ruby -v deleted (ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0])
  • Status changed from Open to Closed
  • Project changed from Ruby 1.8 to Backport187
  • Tracker changed from Bug to Backport

Also available in: Atom PDF