diff options
author | Jean byroot Boussier <jean.boussier+github@shopify.com> | 2022-07-21 19:55:02 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2022-07-21 19:56:08 +0200 |
commit | f0ae583a3d64d3a9d94a193cb999d87b32c8b87b (patch) | |
tree | 9a6e373c3f0d18199d02dfcbf37cb990c14d2e2c | |
parent | 4af0dd36fcc3a5c9a8ec73a28f91ae3ccf94364d (diff) |
Revert "objspace_dump.c: skip dumping method name if not pure ASCII"
This reverts commit 79406e3600862bbb6dcdd7c5ef8de1978e6f916c.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6165
-rw-r--r-- | ext/objspace/objspace_dump.c | 6 | ||||
-rw-r--r-- | test/objspace/test_objspace.rb | 13 |
2 files changed, 2 insertions, 17 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c index b954fe32fc..e4f1216a9a 100644 --- a/ext/objspace/objspace_dump.c +++ b/ext/objspace/objspace_dump.c @@ -547,10 +547,8 @@ dump_object(VALUE obj, struct dump_config *dc) } if (RTEST(ainfo->mid)) { VALUE m = rb_sym2str(ainfo->mid); - if (dump_string_ascii_only(RSTRING_PTR(m), RSTRING_LEN(m))) { - dump_append(dc, ", \"method\":"); - dump_append_string_value(dc, m); - } + dump_append(dc, ", \"method\":"); + dump_append_string_value(dc, m); } dump_append(dc, ", \"generation\":"); dump_append_sizet(dc, ainfo->generation); diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 59ab8e7adc..1392447e4f 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -725,17 +725,4 @@ class TestObjSpace < Test::Unit::TestCase assert_equal '42', out[2] end end - - def test_utf8_method_names - obj = ObjectSpace.trace_object_allocations do - utf8_❨╯°□°❩╯︵┻━┻ - end - assert_nil JSON.parse(ObjectSpace.dump(obj))["method"] - end - - private - - def utf8_❨╯°□°❩╯︵┻━┻ - "1" + "2" - end end |