diff --git a/.eslintrc.json b/.eslintrc.json index 5b341e6d..25190758 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,6 +26,7 @@ "semi": "off", "no-extra-semi": "warn", "no-case-declarations": "warn", - "no-useless-escape" : "warn" + "no-useless-escape" : "warn", + "no-prototype-builtins": "warn" } } diff --git a/media/CircleGraph/view.js b/media/CircleGraph/view.js index 3cbd3f5a..a5ab5fc5 100644 --- a/media/CircleGraph/view.js +++ b/media/CircleGraph/view.js @@ -581,7 +581,7 @@ view.View = class { this._clearSelection(); // set new selection - if (selection.hasOwnProperty('names')) { + if (Object.prototype.hasOwnProperty.call(selection, 'names')) { // selection is by names const names = selection.names; let scrollToSelects = []; // elements to make visible by scroll to @@ -643,7 +643,7 @@ view.View = class { // (3) interate all graph nodes and set if exist in opname, clear if not. // here, (3) is implemented - if (!message.hasOwnProperty('partition')) { + if (!Object.prototype.hasOwnProperty.call(message, 'partition')) { return; } const partition = message.partition; diff --git a/media/PartEditor/index.js b/media/PartEditor/index.js index c450a0a1..4c8216a3 100644 --- a/media/PartEditor/index.js +++ b/media/PartEditor/index.js @@ -359,7 +359,7 @@ editor.Editor = class { this.clearOperatorsCode(); for (let name in this.partition.OPNAME) { - if (this.partition.OPNAME.hasOwnProperty(name)) { + if (Object.prototype.hasOwnProperty.call(this.partition.OPNAME, name)) { let backend = this.partition.OPNAME[name]; let beCode = this.backendCode(backend); if (beCode !== -1) { @@ -430,7 +430,7 @@ editor.Editor = class { backendCode(value) { if (typeof value === 'string') { value = value.toUpperCase(); - if (this.beToCode.hasOwnProperty(value)) { + if (Object.prototype.hasOwnProperty.call(this.beToCode, value)) { return this.beToCode[value]; } } diff --git a/src/PartEditor/PartEditor.ts b/src/PartEditor/PartEditor.ts index 300bc1af..494511fa 100644 --- a/src/PartEditor/PartEditor.ts +++ b/src/PartEditor/PartEditor.ts @@ -328,10 +328,11 @@ class PartEditor implements PartGraphEvent { partContent['partition'] = this.makeDefaultPartiton(); } - if (message.hasOwnProperty('opname')) { + if (Object.prototype.hasOwnProperty.call(message, 'opname')) { partContent.OPNAME = message.opname; } - if (message.hasOwnProperty('partition')) { + + if (Object.prototype.hasOwnProperty.call(message, 'partition')) { partContent.partition = message.partition; }