Skip to content

Commit

Permalink
Fixed #138 - Error: Do not access Object.prototype method
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 11, 2020
1 parent b5f06bf commit cd657d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/datatable/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/components/treetable/TreeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit cd657d8

Please sign in to comment.