diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-11 07:00:32 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-11 07:00:32 +0000 |
commit | c001b601f7363347ec1ebb5c8977aef4036a8d51 (patch) | |
tree | 1d4557123499c292c46777202853b46e7810d8d2 | |
parent | 400390e507804c4ee14bde3f441df8c0a47d0958 (diff) | |
download | ruby-c001b601f7363347ec1ebb5c8977aef4036a8d51.tar.gz ruby-c001b601f7363347ec1ebb5c8977aef4036a8d51.tar.xz ruby-c001b601f7363347ec1ebb5c8977aef4036a8d51.zip |
* eval.c (break_jump): break should not cross functions.
[ruby-list:40818]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | eval.c | 3 | ||||
-rw-r--r-- | lib/date.rb | 3 | ||||
-rw-r--r-- | lib/delegate.rb | 6 | ||||
-rw-r--r-- | object.c | 2 |
5 files changed, 15 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Wed May 11 15:58:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (break_jump): break should not cross functions. + [ruby-list:40818] + Wed May 11 10:41:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> * lib/tempfile.rb (Tempfile#unlink): fixed typo. @@ -4694,6 +4694,9 @@ break_jump(retval) tt->retval = retval; JUMP_TAG(TAG_BREAK); break; + case PROT_FUNC: + tt = 0; + continue; default: break; } diff --git a/lib/date.rb b/lib/date.rb index 1cd4e0804..9d3319823 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -806,12 +806,15 @@ class Date # Get the minute of this date. def min() time[1] end + alias :minute :min # Get the second of this date. def sec() time[2] end + alias :second :sec # Get the fraction-of-a-second of this date. def sec_fraction() time[3] end + alias :second_fraction :sec_fraction private :hour, :min, :sec, :sec_fraction diff --git a/lib/delegate.rb b/lib/delegate.rb index bc200d212..b2e86de6a 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -16,11 +16,11 @@ # ... # end -class Delegator +class Delegator<BasicObject def initialize(obj) - preserved = ::Kernel.public_instance_methods(false) - preserved -= ["to_s","to_a","inspect","==","=~","==="] + preserved = ::BasicObject.public_instance_methods(false) + ::Kernel::p preserved for t in self.class.ancestors preserved |= t.public_instance_methods(false) preserved |= t.private_instance_methods(false) @@ -2453,7 +2453,7 @@ VALUE ruby_top_self; * Creating a new Name * * Classes, modules, and objects are interrelated. In the diagram - * that follows, the arrows represent inheritance, and the + * that follows, the vertical arrows represent inheritance, and the * parentheses meta-classes. All metaclasses are instances * of the class `Class'. * |