Skip to content

Commit a7e7927

Browse files
committed
When duplicating a context, duplicate its term definitions, too.
1 parent c156b10 commit a7e7927

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/json/ld/context.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,9 @@ def dup
18481848
that = self
18491849
ec = super
18501850
ec.instance_eval do
1851-
@term_definitions = that.term_definitions.dup
1851+
@term_definitions = that.term_definitions.inject({}) do |memo, (term, defn)|
1852+
memo.merge(term => defn.dup())
1853+
end
18521854
@iri_to_term = that.iri_to_term.dup
18531855
@inverse_context = nil
18541856
end

0 commit comments

Comments
 (0)