Skip to content

Commit d43b66a

Browse files
committed
Fix some corner-cases when @container includes @set.
1 parent bec4860 commit d43b66a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/json/ld/context.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def initialize(term,
113113
def container_mapping=(mapping)
114114
mapping = Array(mapping)
115115
if @as_set = mapping.include?('@set')
116+
mapping = mapping.dup
116117
mapping.delete('@set')
117118
end
118119
@container_mapping = mapping.first
@@ -1616,7 +1617,7 @@ def check_container(container, local_context, defined, term)
16161617
"'@container' on term #{term.inspect} must be a string: #{container.inspect}"
16171618
end
16181619

1619-
val = Array(container)
1620+
val = Array(container).dup
16201621
val.delete('@set') if has_set = val.include?('@set')
16211622

16221623
raise JsonLdError::InvalidContainerMapping,

0 commit comments

Comments
 (0)