diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-11-07 19:18:16 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-11-07 19:18:16 +0000 |
commit | 54fdacb12545f40e83b013e7c8207fb5416b1403 (patch) | |
tree | a78adc8cdeb42f4a59788e2e5dda13627a130446 /lib | |
parent | 8e3721dfa828464981b5e9f77eff79b815c288d5 (diff) | |
download | ruby-54fdacb12545f40e83b013e7c8207fb5416b1403.tar.gz |
* class.c (rb_define_method): do not set NOEX_CFUNC if klass is
really a module, whose methods must be safe for reciever's type.
* eval.c (rb_eval): nosuper should not be inherited unless the
overwritten method is an undef placeholder.
* parse.y (primary): allow 'when'-less case statement; persuaded
by Sean Chittenden.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/finalize.rb | 12 | ||||
-rw-r--r-- | lib/set.rb | 2 | ||||
-rw-r--r-- | lib/tracer.rb | 8 | ||||
-rw-r--r-- | lib/uri/generic.rb | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/finalize.rb b/lib/finalize.rb index 7d86d94212..ed1ccc830f 100644 --- a/lib/finalize.rb +++ b/lib/finalize.rb @@ -52,17 +52,17 @@ module Finalizer ObjectSpace.call_finalizer(obj) method = method.intern unless method.kind_of?(Integer) assoc = [dependant, method].concat(opt) - if dep = @dependency[obj.id] + if dep = @dependency[obj.object_id] dep.push assoc else - @dependency[obj.id] = [assoc] + @dependency[obj.object_id] = [assoc] end end alias add add_dependency # delete dependency R_method(obj, dependant) def delete_dependency(id, dependant, method = :finalize) - id = id.id unless id.kind_of?(Integer) + id = id.object_id unless id.kind_of?(Integer) method = method.intern unless method.kind_of?(Integer) for assoc in @dependency[id] assoc.delete_if do @@ -76,7 +76,7 @@ module Finalizer # delete dependency R_*(obj, dependant) def delete_all_dependency(id, dependant) - id = id.id unless id.kind_of?(Integer) + id = id.object_id unless id.kind_of?(Integer) method = method.intern unless method.kind_of?(Integer) for assoc in @dependency[id] assoc.delete_if do @@ -104,7 +104,7 @@ module Finalizer # finalize the depandant connected by dependency R_method(obj, dependtant) def finalize_dependency(id, dependant, method = :finalize) - id = id.id unless id.kind_of?(Integer) + id = id.object_id unless id.kind_of?(Integer) method = method.intern unless method.kind_of?(Integer) for assocs in @dependency[id] assocs.delete_if do @@ -119,7 +119,7 @@ module Finalizer # finalize all dependants connected by dependency R_*(obj, dependtant) def finalize_all_dependency(id, dependant) - id = id.id unless id.kind_of?(Integer) + id = id.object_id unless id.kind_of?(Integer) method = method.intern unless method.kind_of?(Integer) for assoc in @dependency[id] assoc.delete_if do diff --git a/lib/set.rb b/lib/set.rb index 945bdd7c98..ec4037a172 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -265,7 +265,7 @@ class Set def flatten_merge(set, seen = Set.new) set.each { |e| if e.is_a?(Set) - if seen.include?(e_id = e.id) + if seen.include?(e_id = e.object_id) raise ArgumentError, "tried to flatten recursive Set" end diff --git a/lib/tracer.rb b/lib/tracer.rb index 70be58da5a..f522a9178d 100644 --- a/lib/tracer.rb +++ b/lib/tracer.rb @@ -39,9 +39,9 @@ class Tracer def initialize @threads = Hash.new if defined? Thread.main - @threads[Thread.main.id] = 0 + @threads[Thread.main.object_id] = 0 else - @threads[Thread.current.id] = 0 + @threads[Thread.current.object_id] = 0 end @get_line_procs = {} @@ -105,10 +105,10 @@ class Tracer end def get_thread_no - if no = @threads[Thread.current.id] + if no = @threads[Thread.current.object_id] no else - @threads[Thread.current.id] = @threads.size + @threads[Thread.current.object_id] = @threads.size end end diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index 73f80c946c..b819dd12b3 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -1130,7 +1130,7 @@ Object =begin =end def inspect - sprintf("#<%s:0x%x URL:%s>", self.class.to_s, self.id, self.to_s) + sprintf("#<%s:0x%x URL:%s>", self.class.to_s, self.object_id, self.to_s) end =begin |