From 3442ae7718679a4da8664bdbb561f746e0357203 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 2 May 2018 06:57:57 +0200 Subject: Fix unsafe "instanceof" negations https://github.com/MoonchildProductions/Pale-Moon/pull/1173 --- toolkit/components/osfile/modules/osfile_unix_front.jsm | 4 ++-- toolkit/components/osfile/modules/osfile_win_front.jsm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'toolkit/components/osfile') 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 = {}; -- cgit v1.2.3