From b59440584d3f404b6d3b71fd8ac2f2a6463f7724 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Wed, 13 Feb 2013 13:56:28 +0000 Subject: [PATCH] Fixed: new file API test caused 'Cannot find function setAttribute in object [object Object]' unit test error. --- AppKit/CPCompatibility.j | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AppKit/CPCompatibility.j b/AppKit/CPCompatibility.j index b9469f692..39d10efc6 100644 --- a/AppKit/CPCompatibility.j +++ b/AppKit/CPCompatibility.j @@ -230,8 +230,13 @@ if (typeof document != "undefined") } // Detect FileAPI support - DOMInputElement.setAttribute("type", "file"); - PLATFORM_FEATURES[CPFileAPIFeature] = !!DOMInputElement["files"]; + if (typeof DOMInputElement.setAttribute === "function") + { + DOMInputElement.setAttribute("type", "file"); + PLATFORM_FEATURES[CPFileAPIFeature] = !!DOMInputElement["files"]; + } + else + PLATFORM_FEATURES[CPFileAPIFeature] = NO; } function CPFeatureIsCompatible(aFeature)