* lib/set.rb (#initialize_copy, #eql): Use instance_variable_get
instead of instance_eval. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f65a21b6f
commit
d4fe9e004a
@ -1,3 +1,8 @@
|
|||||||
|
Sat Sep 1 18:50:50 2012 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* lib/set.rb (#initialize_copy, #eql): Use instance_variable_get
|
||||||
|
instead of instance_eval.
|
||||||
|
|
||||||
Fri Aug 31 21:47:56 2012 Kouhei Sutou <kou@cozmixng.org>
|
Fri Aug 31 21:47:56 2012 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
* lib/test/unit/test-unit.gemspec: Make test/unit default gem.
|
* lib/test/unit/test-unit.gemspec: Make test/unit default gem.
|
||||||
|
@ -96,7 +96,7 @@ class Set
|
|||||||
|
|
||||||
# Copy internal hash.
|
# Copy internal hash.
|
||||||
def initialize_copy(orig)
|
def initialize_copy(orig)
|
||||||
@hash = orig.instance_eval{@hash}.dup
|
@hash = orig.instance_variable_get(:@hash).dup
|
||||||
end
|
end
|
||||||
|
|
||||||
def freeze # :nodoc:
|
def freeze # :nodoc:
|
||||||
@ -384,7 +384,7 @@ class Set
|
|||||||
|
|
||||||
def eql?(o) # :nodoc:
|
def eql?(o) # :nodoc:
|
||||||
return false unless o.is_a?(Set)
|
return false unless o.is_a?(Set)
|
||||||
@hash.eql?(o.instance_eval{@hash})
|
@hash.eql?(o.instance_variable_get(:@hash))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Classifies the set by the return value of the given block and
|
# Classifies the set by the return value of the given block and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user