From 6761a93bcb8278c80921338fa2f8a2e4cf8f6121 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 10 Jul 2017 16:05:25 -0400 Subject: [PATCH] Bug 1371259 part 5. Use a safer implementation of IsFileList. r=peterv --- js/xpconnect/src/ExportHelpers.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/js/xpconnect/src/ExportHelpers.cpp b/js/xpconnect/src/ExportHelpers.cpp index e2af67b80705..cf04c9adce32 100644 --- a/js/xpconnect/src/ExportHelpers.cpp +++ b/js/xpconnect/src/ExportHelpers.cpp @@ -13,6 +13,7 @@ #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/BlobBinding.h" #include "mozilla/dom/File.h" +#include "mozilla/dom/FileListBinding.h" #include "mozilla/dom/StructuredCloneHolder.h" #include "nsGlobalWindow.h" #include "nsJSUtils.h" @@ -52,13 +53,7 @@ enum StackScopedCloneTags { // per scope. bool IsFileList(JSObject* obj) { - nsISupports* supports = UnwrapReflectorToISupports(obj); - if (!supports) - return false; - nsCOMPtr fileList = do_QueryInterface(supports); - if (fileList) - return true; - return false; + return IS_INSTANCE_OF(FileList, obj); } class MOZ_STACK_CLASS StackScopedCloneData