Add test for '==' in Regexp
@@ -90,15 +90,11 @@ func builtinRegexpInstanceMethods() []*BuiltinMethodObject {
lv := receiver.(*RegexpObject).Value()
arg := args[0]
- if n := arg.Class().Name; n == "Regexp" {
- rv = arg.toString()
- } else {
- if n != "String" {
+ if n := arg.Class().Name; n == "Regexp" || n == "String" {
rv = arg.toString()
} else {
return FALSE
}
- }
if lv == rv {
return TRUE
