Fixed #329: Editor showing duplicate key warnings for keys defined on the Object prototype, like `toString` and `watch`

This commit is contained in:
jos 2016-10-15 10:49:44 +02:00
parent cee259f2a5
commit 8913ce1f6f
2 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor
## not yet released, version 5.5.9
- Fixed #329: Editor showing duplicate key warnings for keys defined on the
Object prototype, like `toString` and `watch`.
## 2016-09-27, version 5.5.8
- Fixed #314: JSON schema validation throwing an error "Unexpected token ' in

View File

@ -1416,7 +1416,7 @@ Node.prototype.validate = function () {
var duplicateKeys = [];
for (var i = 0; i < this.childs.length; i++) {
var child = this.childs[i];
if (keys[child.field]) {
if (keys.hasOwnProperty(child.field)) {
duplicateKeys.push(child.field);
}
keys[child.field] = true;