Parse invalid array

This commit is contained in:
Benoit Blanchon
2014-10-14 17:28:57 +02:00
parent f468db6757
commit 081b345e7c
5 changed files with 51 additions and 20 deletions

View File

@ -146,4 +146,21 @@ void JsonNode::setAsProxyOfSelf()
*newNode = *this;
setAsProxyOf(newNode);
}
void JsonNode::duplicate(JsonNode* other)
{
if (!other)
{
type = JSON_UNDEFINED;
}
else if (other->type == JSON_ARRAY || other->type==JSON_OBJECT)
{
other->setAsProxyOfSelf();
setAsProxyOf(other->content.asProxy.target);
}
else
{
*this = *other;
}
}