Revert "Improve warning message"
This reverts commit 31110d820cc1258cbc84b46ecc65b254c7d5529a.
This commit is contained in:
parent
34a66b1f36
commit
a705f6472c
4
re.c
4
re.c
@ -3300,7 +3300,7 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NIL_P(str)) {
|
if (NIL_P(str)) {
|
||||||
rb_warn("given argument is nil; this will raise a TypeError in the next release");
|
rb_warn("given argument is nil");
|
||||||
}
|
}
|
||||||
pos = reg_match_pos(re, &str, pos);
|
pos = reg_match_pos(re, &str, pos);
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
@ -3348,7 +3348,7 @@ rb_reg_match_p(VALUE re, VALUE str, long pos)
|
|||||||
int tmpreg;
|
int tmpreg;
|
||||||
|
|
||||||
if (NIL_P(str)) {
|
if (NIL_P(str)) {
|
||||||
rb_warn("given argument is nil; this will raise a TypeError in the next release");
|
rb_warn("given argument is nil");
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
}
|
}
|
||||||
str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str);
|
str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str);
|
||||||
|
@ -104,7 +104,7 @@ describe "Regexp#match" do
|
|||||||
|
|
||||||
ruby_version_is "2.7"..."3.0" do
|
ruby_version_is "2.7"..."3.0" do
|
||||||
it "warns the deprecation when the given argument is nil" do
|
it "warns the deprecation when the given argument is nil" do
|
||||||
-> { /foo/.match(nil) }.should complain(/given argument is nil; this will raise a TypeError in the next release/)
|
-> { /foo/.match(nil) }.should complain(/given argument is nil/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ describe "Regexp#match?" do
|
|||||||
|
|
||||||
ruby_version_is "2.7"..."3.0" do
|
ruby_version_is "2.7"..."3.0" do
|
||||||
it "warns the deprecation" do
|
it "warns the deprecation" do
|
||||||
-> { /./.match?(nil) }.should complain(/given argument is nil; this will raise a TypeError in the next release/)
|
-> { /./.match?(nil) }.should complain(/given argument is nil/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user