Fix unsafe "instanceof" negations

https://github.com/MoonchildProductions/Pale-Moon/pull/1173
This commit is contained in:
janekptacijarabaci 2018-05-02 06:57:57 +02:00 • committed by Roy Tam
commit b56d147095
17 changed files with 19 additions and 28 deletions

View file

@ -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 = {};

View file

@ -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 = {};

View file

@ -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",

View file

@ -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",