Fix bug 871255 - Warning 'TypeError: redeclaration of var calInstanceOf' in calUtils.js. r=mschroeder
authorPhilipp Kewisch <mozilla@kewis.ch>
Tue, 05 Nov 2013 17:46:27 +0100
changeset 13247 76f711a54fd39f802bbac0d68b86fac3d8741067
parent 13246 3c207e4668a0d0c8605d7b29659d99b691ac6d7d
child 13248 752e81dfb822ef5f2707d1ccc834bd9476a19db9
push id9629
push usermozilla@kewis.ch
push dateTue, 05 Nov 2013 16:53:08 +0000
treeherdercomm-central@76f711a54fd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmschroeder
bugs871255
Fix bug 871255 - Warning 'TypeError: redeclaration of var calInstanceOf' in calUtils.js. r=mschroeder
calendar/base/src/calUtils.js
--- a/calendar/base/src/calUtils.js
+++ b/calendar/base/src/calUtils.js
@@ -425,36 +425,16 @@ function calInstanceOf(aObject, aInterfa
                  "with the next release. Use cal.wrapInstance() instead.\n" +
                  cal.STACK(10));
         calInstanceOf.warningIssued = true;
     }
     return (cal.wrapInstance(aObject, aInterface) != null);
 }
 
 /**
- * (At least on branch 1.8), the js instanceof operator does not work to test
- * interfaces on direct implementation objects, i.e. non-wrapped objects.
- * This function falla back to using QueryInterface to check whether the interface
- * is implemented.
- */
-function calInstanceOf(aObject, aInterface) {
-    // We first try instanceof which is assumed to be faster than querying the object:
-    if (!(aObject instanceof aInterface)) {
-        // if the passed object in not wrapped (but a plain implementation),
-        // instanceof won't check QueryInterface.
-        try {
-            aObject.QueryInterface(aInterface);
-        } catch (exc) {
-            return false;
-        }
-    }
-    return true;
-}
-
-/**
  * Determines whether or not the aObject is a calIEvent
  *
  * @param aObject  the object to test
  * @returns        true if the object is a calIEvent, false otherwise
  */
 function isEvent(aObject) {
     return (cal.wrapInstance(aObject, Components.interfaces.calIEvent) != null);
 }