Permalink
Browse files

Stop SafeBuffer#clone_empty from issuing warnings

Logic in clone_empty method was dealing with old @dirty variable, which
has changed by @html_safe in this commit:
rails@139963c

This was issuing a "not initialized variable" warning - related to:
rails#5237

The logic applied by this method is already handled by the [] override,
so there is no need to reset the variable here.
  • Loading branch information...
1 parent 1a71e84 commit 5fd360133a569c033dc2904fe3f4eed615586106 @carlosantoniodasilva carlosantoniodasilva committed with drogus Mar 2, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 activesupport/lib/active_support/core_ext/string/output_safety.rb
View
4 activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -126,9 +126,7 @@ def initialize_copy(other)
end
def clone_empty
- new_safe_buffer = self[0, 0]
- new_safe_buffer.instance_variable_set(:@dirty, @dirty)
- new_safe_buffer
+ self[0, 0]
end
def concat(value)

0 comments on commit 5fd3601

Please sign in to comment.