From cac4da9858b3cef6aab6561f32eaefe2c3b2e905 Mon Sep 17 00:00:00 2001 From: tmm1 Date: Fri, 22 Nov 2013 23:50:06 +0000 Subject: * 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 --- lib/set.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/set.rb') 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 -- cgit v1.2.3