forked from p15670423/monkey
Fix "Do not access Object.prototype method 'hasOwnProperty' from target object" eslint warnings
This commit is contained in:
parent
e74e205368
commit
c736560f09
|
@ -56,7 +56,7 @@ const getContents = (props) => {
|
|||
// update existing state, not run-over
|
||||
let prevRes = result;
|
||||
for (let key in result) {
|
||||
if (result.hasOwnProperty(key)) {
|
||||
if (Object.prototype.hasOwnProperty.call(result, key)) {
|
||||
prevRes[key] = result[key];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -437,9 +437,9 @@ class ReportPageComponent extends AuthComponent {
|
|||
|
||||
isIssuePotentialSecurityIssue(issueName) {
|
||||
let issueDescriptor = this.IssueDescriptorEnum[issueName];
|
||||
return issueDescriptor.hasOwnProperty(this.issueContentTypes.TYPE) &&
|
||||
return Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.TYPE) &&
|
||||
issueDescriptor[this.issueContentTypes.TYPE] === this.issueTypes.WARNING &&
|
||||
issueDescriptor.hasOwnProperty(this.issueContentTypes.OVERVIEW);
|
||||
Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.OVERVIEW);
|
||||
}
|
||||
|
||||
getImmediateThreats() {
|
||||
|
@ -476,9 +476,9 @@ class ReportPageComponent extends AuthComponent {
|
|||
|
||||
isIssueImmediateThreat(issueName) {
|
||||
let issueDescriptor = this.IssueDescriptorEnum[issueName];
|
||||
return issueDescriptor.hasOwnProperty(this.issueContentTypes.TYPE) &&
|
||||
return Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.TYPE) &&
|
||||
issueDescriptor[this.issueContentTypes.TYPE] === this.issueTypes.DANGER &&
|
||||
issueDescriptor.hasOwnProperty(this.issueContentTypes.OVERVIEW);
|
||||
Object.prototype.hasOwnProperty.call(issueDescriptor, this.issueContentTypes.OVERVIEW);
|
||||
}
|
||||
|
||||
getImmediateThreatsOverviews() {
|
||||
|
@ -598,7 +598,7 @@ class ReportPageComponent extends AuthComponent {
|
|||
let issueDescriptor = this.IssueDescriptorEnum[issue.type];
|
||||
|
||||
let reportFnc = {};
|
||||
if (issue.hasOwnProperty('credential_type') && issue.credential_type !== null) {
|
||||
if (Object.prototype.hasOwnProperty.call(issue, 'credential_type') && issue.credential_type !== null) {
|
||||
reportFnc = issueDescriptor[this.issueContentTypes.REPORT][issue.credential_type];
|
||||
} else {
|
||||
reportFnc = issueDescriptor[this.issueContentTypes.REPORT];
|
||||
|
|
Loading…
Reference in New Issue