diff --git a/HISTORY.md b/HISTORY.md index 6c8a4e0..92bbe7e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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 diff --git a/src/js/Node.js b/src/js/Node.js index f7bcd8d..ad6592b 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -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;