mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Reject objects with duplicate keys.
This commit is contained in:
@@ -505,6 +505,11 @@ Reader::readObject( Token &tokenStart )
|
||||
colon,
|
||||
tokenObjectEnd );
|
||||
}
|
||||
|
||||
// Reject duplicate names
|
||||
if (currentValue().isMember(name))
|
||||
return addError( "Key '" + name + "' appears twice.", tokenName );
|
||||
|
||||
Value &value = currentValue()[ name ];
|
||||
nodes_.push( &value );
|
||||
bool ok = readValue();
|
||||
|
||||
Reference in New Issue
Block a user