зеркало из https://github.com/github/ruby.git
Dump Hash ivars before elements
When the Hash is revived, the ivars will be set before elements. This is for the case when the hash setter depends on ivars set on the hash.
This commit is contained in:
Родитель
0016edbead
Коммит
03dac55f90
|
@ -428,15 +428,6 @@ module Psych
|
|||
node = @emitter.start_mapping(nil, tag, false, Psych::Nodes::Mapping::BLOCK)
|
||||
register(o, node)
|
||||
|
||||
# Dump the elements
|
||||
accept 'elements'
|
||||
@emitter.start_mapping nil, nil, true, Nodes::Mapping::BLOCK
|
||||
o.each do |k,v|
|
||||
accept k
|
||||
accept v
|
||||
end
|
||||
@emitter.end_mapping
|
||||
|
||||
# Dump the ivars
|
||||
accept 'ivars'
|
||||
@emitter.start_mapping nil, nil, true, Nodes::Mapping::BLOCK
|
||||
|
@ -446,6 +437,15 @@ module Psych
|
|||
end
|
||||
@emitter.end_mapping
|
||||
|
||||
# Dump the elements
|
||||
accept 'elements'
|
||||
@emitter.start_mapping nil, nil, true, Nodes::Mapping::BLOCK
|
||||
o.each do |k,v|
|
||||
accept k
|
||||
accept v
|
||||
end
|
||||
@emitter.end_mapping
|
||||
|
||||
@emitter.end_mapping
|
||||
else
|
||||
tag = "!ruby/hash:#{o.class}"
|
||||
|
|
Загрузка…
Ссылка в новой задаче