summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--eval.c6
-rw-r--r--lib/drb/drb.rb2
-rw-r--r--lib/yaml/rubytypes.rb2
-rw-r--r--test/ruby/test_iterator.rb4
-rw-r--r--test/ruby/test_proc.rb4
6 files changed, 18 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 79863e30e..92e06c597 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,15 @@ Thu Mar 18 17:46:35 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb: do not undef :to_a.
+Thu Mar 18 16:22:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (proc_eq): avoid false positive by using scope and
+ dyna_vars. no longer use frame.uniq.
+
+ * eval.c (proc_arity): arity is now defined as number of
+ parameters that would not be ignored. i.e. Proc.new{}.arity
+ returns zero. update test suites too.
+
Thu Mar 18 15:27:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c: remove specialized version of rb_Array(). use simple
diff --git a/eval.c b/eval.c
index 46418a556..ab46894f7 100644
--- a/eval.c
+++ b/eval.c
@@ -8160,9 +8160,8 @@ proc_arity(proc)
data->body->nd_cfnc == bmcall) {
return method_arity(data->body->nd_tval);
}
- return INT2FIX(-1);
+ return INT2FIX(0);
}
- if (!(data->flags & BLOCK_LAMBDA)) return INT2FIX(-1);
if (data->var == (NODE*)1) return INT2FIX(0);
if (data->var == (NODE*)2) return INT2FIX(0);
switch (nd_type(data->var)) {
@@ -8202,7 +8201,8 @@ proc_eq(self, other)
Data_Get_Struct(other, struct BLOCK, data2);
if (data->body != data2->body) return Qfalse;
if (data->var != data2->var) return Qfalse;
- if (data->frame.uniq != data2->frame.uniq) return Qfalse;
+ if (data->scope != data2->scope) return Qfalse;
+ if (data->dyna_vars != data2->dyna_vars) return Qfalse;
if (data->flags != data2->flags) return Qfalse;
return Qtrue;
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 2f0f96adc..c056c4116 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -1000,7 +1000,7 @@ module DRb
end
undef :to_s
- undef :to_a if respond_to?(:respond_to)
+ undef :to_a if respond_to?(:to_a)
undef :respond_to?
# Routes method calls to the referenced object.
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index ac772bc07..3fc243710 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -353,7 +353,7 @@ class Range
def to_yaml( opts = {} )
YAML::quick_emit( nil, opts ) { |out|
out << "!ruby/range "
- self.to_s.to_yaml( :Emitter => out )
+ self.to_s.to_yaml(:Emitter => out)
}
end
end
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index 38e795ee7..1c293069c 100644
--- a/test/ruby/test_iterator.rb
+++ b/test/ruby/test_iterator.rb
@@ -311,8 +311,8 @@ class TestIterator < Test::Unit::TestCase
block = get_block{11}
lambda = lambda{44}
- assert_equal(-1, block.arity)
- assert_equal(-1, lambda.arity)
+ assert_equal(0, block.arity)
+ assert_equal(0, lambda.arity)
assert_equal(0, lambda{||}.arity)
assert_equal(1, lambda{|a|}.arity)
assert_equal(1, lambda{|a,|}.arity)
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index f0b78ffb2..8d8b17e0d 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -50,7 +50,7 @@ class TestProc < Test::Unit::TestCase
end
def test_arity
- assert_equal(-1, proc{}.arity)
+ assert_equal(0, proc{}.arity)
assert_equal(0, proc{||}.arity)
assert_equal(1, proc{|x|}.arity)
assert_equal(2, proc{|x, y|}.arity)
@@ -58,7 +58,7 @@ class TestProc < Test::Unit::TestCase
assert_equal(-1, proc{|*x|}.arity)
assert_equal(-1, proc{|*|}.arity)
- assert_arity(-1) {}
+ assert_arity(0) {}
assert_arity(0) {||}
assert_arity(1) {|x|}
assert_arity(2) {|x, y|}