From 8e8e34319ba6d9457b3ffa374738baa41a96be05 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 12 Aug 2009 05:55:06 +0000 Subject: * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: check definition of (classes)#=== for case/when optimization. Fix Bug #1376 [ruby-core:23190]. * string.c (Init_String), bignum.c (Init_Bignum), numeric.c (Init_Numeric): define String#===, Symbol#===, Bignum#===, Fixnum#===, Float#=== as same as (classes)#==. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 3c64fc81c1..ecaf9c503b 100644 --- a/numeric.c +++ b/numeric.c @@ -3222,6 +3222,7 @@ Init_Numeric(void) rb_define_method(rb_cFixnum, "magnitude", fix_abs, 0); rb_define_method(rb_cFixnum, "==", fix_equal, 1); + rb_define_method(rb_cFixnum, "===", fix_equal, 1); rb_define_method(rb_cFixnum, "<=>", fix_cmp, 1); rb_define_method(rb_cFixnum, ">", fix_gt, 1); rb_define_method(rb_cFixnum, ">=", fix_ge, 1); @@ -3275,6 +3276,7 @@ Init_Numeric(void) rb_define_method(rb_cFloat, "divmod", flo_divmod, 1); rb_define_method(rb_cFloat, "**", flo_pow, 1); rb_define_method(rb_cFloat, "==", flo_eq, 1); + rb_define_method(rb_cFloat, "===", flo_eq, 1); rb_define_method(rb_cFloat, "<=>", flo_cmp, 1); rb_define_method(rb_cFloat, ">", flo_gt, 1); rb_define_method(rb_cFloat, ">=", flo_ge, 1); -- cgit v1.2.1