mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Remove implicit conversion using to_str method; fix #3854
We have added internal convenience method `__to_str` which does string type check. The issue #3854 was fixed but fundamental flaw of lack of stack depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA` for workaround.
This commit is contained in:
@@ -253,19 +253,6 @@ assert('String#chomp!', '15.2.10.5.10') do
|
||||
assert_equal 'abc', e
|
||||
end
|
||||
|
||||
assert('String#chomp! uses the correct length') do
|
||||
class A
|
||||
def to_str
|
||||
$s.replace("AA")
|
||||
"A"
|
||||
end
|
||||
end
|
||||
|
||||
$s = "AAA"
|
||||
$s.chomp!(A.new)
|
||||
assert_equal $s, "A"
|
||||
end
|
||||
|
||||
assert('String#chop', '15.2.10.5.11') do
|
||||
a = ''.chop
|
||||
b = 'abc'.chop
|
||||
|
||||
Reference in New Issue
Block a user