Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix breakage from StorageList going away.

  • Loading branch information...
commit 4629c495b5c2881f2a6f993c79a10ec27692f0c4 1 parent 8d1a151
Simon Lindholm authored April 06, 2012
4  extension/content/firebug/chrome/reps.js
@@ -658,7 +658,7 @@ FirebugReps.Arr = domplate(Firebug.Rep,
658 658
             else if (obj instanceof Ci.nsIDOMHistory)
659 659
                 return false;
660 660
             // do this first to avoid security 1000 errors
661  
-            else if (obj instanceof view.StorageList)
  661
+            else if ("StorageList" in view && obj instanceof view.StorageList)
662 662
                 return false;
663 663
             // do this first to avoid exceptions
664 664
             else if (obj.toString() === "[xpconnect wrapped native prototype]")
@@ -2704,7 +2704,7 @@ FirebugReps.StorageList = domplate(Firebug.Rep,
2704 2704
 
2705 2705
     supportsObject: function(object, type)
2706 2706
     {
2707  
-        return (object instanceof window.StorageList);
  2707
+        return ("StorageList" in window && object instanceof window.StorageList);
2708 2708
     },
2709 2709
 
2710 2710
     getRealObject: function(object, context)
4  extension/content/firebug/dom/domPanel.js
@@ -436,7 +436,7 @@ Firebug.DOMBasePanel.prototype = Obj.extend(Firebug.Panel,
436 436
             if (isArguments(object))
437 437
                 object = Arr.cloneArray(object);
438 438
 
439  
-            if (object instanceof window.StorageList)
  439
+            if ("StorageList" in window && object instanceof window.StorageList)
440 440
             {
441 441
                 var domain = context.window.location.hostname;
442 442
                 object = object.namedItem(domain);
@@ -663,7 +663,7 @@ Firebug.DOMBasePanel.prototype = Obj.extend(Firebug.Panel,
663 663
             }
664 664
         }
665 665
 
666  
-        if (value instanceof window.StorageList)
  666
+        if ("StorageList" in window && value instanceof window.StorageList)
667 667
         {
668 668
             var domain = context.window.location.hostname;
669 669
             hasChildren = value.namedItem(domain).length > 0;
12  extension/content/firebug/lib/wrapper.js
@@ -21,7 +21,7 @@ Wrapper.getContentView = function(object)
21 21
 
22 22
     // There is an exception when accessing StorageList.wrappedJSObject (which is
23 23
     // instance of StorageObsolete)
24  
-    if (object instanceof window.StorageList)
  24
+    if ("StorageList" in object && object instanceof window.StorageList)
25 25
         return false;
26 26
 
27 27
     return (object.wrappedJSObject);
@@ -35,14 +35,8 @@ Wrapper.unwrapObject = function(object)
35 35
 
36 36
     // There is an exception when accessing StorageList.wrappedJSObject (which is
37 37
     // instance of StorageObsolete)
38  
-    try
39  
-    {
40  
-        if (object instanceof window.StorageList)
41  
-            return object;
42  
-    }
43  
-    catch (e)
44  
-    {
45  
-    }
  38
+    if ("StorageList" in object && object instanceof window.StorageList)
  39
+        return object;
46 40
 
47 41
     if (object.wrappedJSObject)
48 42
         return object.wrappedJSObject;

0 notes on commit 4629c49

Please sign in to comment.
Something went wrong with that request. Please try again.