diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2021-02-11 18:30:58 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-05-10 19:17:32 +0900 |
commit | c110ade0d235391c2fbfe9291250f744b735a1a8 (patch) | |
tree | fcda2db839e3567ae8e2c99130a5adf122e5a4d0 /ext | |
parent | 155cd7fd2a4d5d3a732f73d42385048e16dfbc23 (diff) | |
download | ruby-c110ade0d235391c2fbfe9291250f744b735a1a8.tar.gz |
[ruby/psych] Fix custom marshalization with symbolize_names: true
https://github.com/ruby/psych/commit/ee26f26ab5
Diffstat (limited to 'ext')
-rw-r--r-- | ext/psych/lib/psych/visitors/to_ruby.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb index a10018812b..4d98850f75 100644 --- a/ext/psych/lib/psych/visitors/to_ruby.rb +++ b/ext/psych/lib/psych/visitors/to_ruby.rb @@ -339,7 +339,7 @@ module Psych list end - def revive_hash hash, o + def revive_hash hash, o, tagged= false o.children.each_slice(2) { |k,v| key = accept(k) val = accept(v) @@ -366,7 +366,7 @@ module Psych hash[key] = val end else - if @symbolize_names + if !tagged && @symbolize_names key = key.to_sym elsif !@freeze key = deduplicate(key) @@ -404,7 +404,7 @@ module Psych def revive klass, node s = register(node, klass.allocate) - init_with(s, revive_hash({}, node), node) + init_with(s, revive_hash({}, node, true), node) end def init_with o, h, node |