diff options
author | tmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 23:50:06 +0000 |
---|---|---|
committer | tmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 23:50:06 +0000 |
commit | cac4da9858b3cef6aab6561f32eaefe2c3b2e905 (patch) | |
tree | a84818c73f7b602bbe6489f8dcd6b62445b119be /lib/set.rb | |
parent | e8e18cff7a7f61e4cf3ee390e1d6da31ecb9a9e4 (diff) | |
download | ruby-cac4da9858b3cef6aab6561f32eaefe2c3b2e905.tar.gz |
* lib/set.rb (class SortedSet): Fix source_location for methods defined via eval.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/set.rb')
-rw-r--r-- | lib/set.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/set.rb b/lib/set.rb index cc068f0a52..e30d590c5d 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -574,7 +574,7 @@ class SortedSet < Set begin require 'rbtree' - module_eval %{ + module_eval <<-END, __FILE__, __LINE__+1 def initialize(*args) @hash = RBTree.new super @@ -585,9 +585,9 @@ class SortedSet < Set super end alias << add - } + END rescue LoadError - module_eval %{ + module_eval <<-END, __FILE__, __LINE__+1 def initialize(*args) @keys = nil super @@ -647,7 +647,7 @@ class SortedSet < Set (@keys = @hash.keys).sort! unless @keys @keys end - } + END end module_eval { # a hack to shut up warning |