diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-05-02 06:57:57 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-05-02 06:57:57 +0200 |
commit | 3442ae7718679a4da8664bdbb561f746e0357203 (patch) | |
tree | 5ed661a5998ac91f309bb27cb5ae52dfb4178cca /toolkit/components | |
parent | 61de1c80cdc6c04e71fde07cc5028af503438134 (diff) | |
download | UXP-3442ae7718679a4da8664bdbb561f746e0357203.tar UXP-3442ae7718679a4da8664bdbb561f746e0357203.tar.gz UXP-3442ae7718679a4da8664bdbb561f746e0357203.tar.lz UXP-3442ae7718679a4da8664bdbb561f746e0357203.tar.xz UXP-3442ae7718679a4da8664bdbb561f746e0357203.zip |
Fix unsafe "instanceof" negations
https://github.com/MoonchildProductions/Pale-Moon/pull/1173
Diffstat (limited to 'toolkit/components')
4 files changed, 4 insertions, 10 deletions
diff --git a/toolkit/components/osfile/modules/osfile_unix_front.jsm b/toolkit/components/osfile/modules/osfile_unix_front.jsm index 19a27ae1a..bd60d4d84 100644 --- a/toolkit/components/osfile/modules/osfile_unix_front.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_front.jsm @@ -838,7 +838,7 @@ * implementation. */ File.DirectoryIterator.Entry.toMsg = function toMsg(value) { - if (!value instanceof File.DirectoryIterator.Entry) { + if (!(value instanceof File.DirectoryIterator.Entry)) { throw new TypeError("parameter of " + "File.DirectoryIterator.Entry.toMsg must be a " + "File.DirectoryIterator.Entry"); @@ -905,7 +905,7 @@ * is asymmetric and returns an object with a different implementation. */ File.Info.toMsg = function toMsg(stat) { - if (!stat instanceof File.Info) { + if (!(stat instanceof File.Info)) { throw new TypeError("parameter of File.Info.toMsg must be a File.Info"); } let serialized = {}; diff --git a/toolkit/components/osfile/modules/osfile_win_front.jsm b/toolkit/components/osfile/modules/osfile_win_front.jsm index 387dd08b5..1123b251c 100644 --- a/toolkit/components/osfile/modules/osfile_win_front.jsm +++ b/toolkit/components/osfile/modules/osfile_win_front.jsm @@ -909,7 +909,7 @@ * implementation. */ File.DirectoryIterator.Entry.toMsg = function toMsg(value) { - if (!value instanceof File.DirectoryIterator.Entry) { + if (!(value instanceof File.DirectoryIterator.Entry)) { throw new TypeError("parameter of " + "File.DirectoryIterator.Entry.toMsg must be a " + "File.DirectoryIterator.Entry"); @@ -958,7 +958,7 @@ * is asymmetric and returns an object with a different implementation. */ File.Info.toMsg = function toMsg(stat) { - if (!stat instanceof File.Info) { + if (!(stat instanceof File.Info)) { throw new TypeError("parameter of File.Info.toMsg must be a File.Info"); } let serialized = {}; diff --git a/toolkit/components/reader/.eslintrc.js b/toolkit/components/reader/.eslintrc.js index 1c09e0bf7..617c1f9cf 100644 --- a/toolkit/components/reader/.eslintrc.js +++ b/toolkit/components/reader/.eslintrc.js @@ -109,9 +109,6 @@ module.exports = { // No reassigning native JS objects "no-native-reassign": "error", - // No (!foo in bar) - "no-negated-in-lhs": "error", - // Nested ternary statements are confusing "no-nested-ternary": "error", diff --git a/toolkit/components/webextensions/.eslintrc.js b/toolkit/components/webextensions/.eslintrc.js index 70196fc6a..70f91ab6d 100644 --- a/toolkit/components/webextensions/.eslintrc.js +++ b/toolkit/components/webextensions/.eslintrc.js @@ -173,9 +173,6 @@ module.exports = { // eslint-disable-line no-undef // No reassigning native JS objects "no-native-reassign": "error", - // No (!foo in bar) - "no-negated-in-lhs": "error", - // Nested ternary statements are confusing "no-nested-ternary": "error", |