dkubb / ice_nine

Deep Freeze Ruby Objects
MIT License
307 stars 19 forks source link

IceNine.deep_freeze(SimpleDelegator.new(nil)) freezes nil #17

Open mbj opened 9 years ago

mbj commented 9 years ago

I personally do not have problems with freezing nil. As I do not want anything in my apps to metaprogram around in nil's public interface.

But as there are special precautions NOT to freeze nil via the IceNine::Freezer::NilClass I wounder if we should guard against this case or drop the nil specific freezer for symmetry.

Background:

I noticed that the SimpleDelegator freezes nil when updating dependencies to rspec3 where some unrelated edge case made me print nil.frozen?.

A commit in that PR fixes the specs not to call IceNine.deep_freeze(SimpleDelegator.new(nil)) already.

I'm curios what you think about freezing nil @dkubb.