From cd657d8add086e3d073423b632d3eeb0ad32b9dc Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Sat, 11 Jan 2020 12:18:45 +0300 Subject: [PATCH] Fixed #138 - Error: Do not access Object.prototype method --- src/components/datatable/DataTable.vue | 4 ++-- src/components/treetable/TreeTable.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 45c1a9000..e898c4d35 100644 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -575,7 +575,7 @@ export default { let columnField = col.field; //local - if (this.filters.hasOwnProperty(columnField)) { + if (Object.prototype.hasOwnProperty.call(this.filters, columnField)) { let filterValue = this.filters[columnField]; let dataFieldValue = ObjectUtils.resolveFieldData(data[i], columnField); let filterConstraint = FilterUtils[col.filterMatchMode]; @@ -1769,7 +1769,7 @@ export default { return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object; }, hasGlobalFilter() { - return this.filters && this.filters.hasOwnProperty('global'); + return this.filters && Object.prototype.hasOwnProperty.call(this.filters, 'global'); }, loadingIconClass() { return ['p-datatable-loading-icon pi-spin', this.loadingIcon]; diff --git a/src/components/treetable/TreeTable.vue b/src/components/treetable/TreeTable.vue index c6b94f4e4..e5fe617d1 100644 --- a/src/components/treetable/TreeTable.vue +++ b/src/components/treetable/TreeTable.vue @@ -544,7 +544,7 @@ export default { let filterField = col.field; //local - if (this.filters.hasOwnProperty(col.field)) { + if (Object.prototype.hasOwnProperty.call(this.filters, col.field)) { let filterMatchMode = col.filterMatchMode; let filterValue = this.filters[col.field]; let filterConstraint = FilterUtils[filterMatchMode]; @@ -810,7 +810,7 @@ export default { return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object; }, hasGlobalFilter() { - return this.filters && this.filters.hasOwnProperty('global'); + return this.filters && Object.prototype.hasOwnProperty.call(this.filters, 'global'); }, paginatorTop() { return this.paginator && (this.paginatorPosition !== 'bottom' || this.paginatorPosition === 'both');