Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

We need to unwrap to make instanceof working properly (related to iss…

…ue 5786)
  • Loading branch information...
commit 326b4e3b26bc15888aa87ae7db5ce8bd3e0512bf 1 parent 15a0009
Jan Odvarko authored October 04, 2012

Showing 1 changed file with 10 additions and 8 deletions. Show diff stats Hide diff stats

  1. 18  extension/content/firebug/chrome/reps.js
18  extension/content/firebug/chrome/reps.js
@@ -559,7 +559,6 @@ function mightBeArray(obj, win)
559 559
 FirebugReps.ArrBase = domplate(FirebugReps.Obj,
560 560
 {
561 561
     className: "array",
562  
-
563 562
     toggles: new ToggleBranch.ToggleBranch(),
564 563
 
565 564
     titleTag:
@@ -579,12 +578,12 @@ FirebugReps.ArrBase = domplate(FirebugReps.Obj,
579 578
 
580 579
     longArrayIterator: function(array)
581 580
     {
582  
-       return this.arrayIterator(array, 300);
  581
+        return this.arrayIterator(array, 300);
583 582
     },
584 583
 
585 584
     shortArrayIterator: function(array)
586 585
     {
587  
-       return this.arrayIterator(array, Options.get("ObjectShortIteratorMax"));
  586
+        return this.arrayIterator(array, Options.get("ObjectShortIteratorMax"));
588 587
     },
589 588
 
590 589
     arrayIterator: function(array, max)
@@ -838,10 +837,11 @@ FirebugReps.ArrayLikeObject = domplate(FirebugReps.ArrBase,
838 837
         Firebug.chrome.select(obj);
839 838
     },
840 839
 
841  
-    getTitle: function(object, context)
  840
+    getTitle: function(obj, context)
842 841
     {
  842
+        var arr = Wrapper.unwrapObject(obj);
843 843
         const re =/\[object ([^\]]*)/;
844  
-        var label = Str.safeToString(object);
  844
+        var label = Str.safeToString(arr);
845 845
         var m = re.exec(label);
846 846
         return m[1] || label;
847 847
     },
@@ -850,12 +850,14 @@ FirebugReps.ArrayLikeObject = domplate(FirebugReps.ArrBase,
850 850
     {
851 851
         if (mightBeArray(obj, win))
852 852
         {
  853
+            var view = Wrapper.getContentView(win || window);
  854
+            var arr = Wrapper.unwrapObject(obj);
  855
+
853 856
             if (isFinite(obj.length) && typeof obj.splice === "function" && obj.length)
854 857
                 return true;
855  
-            var view = Wrapper.getContentView(win || window);
856  
-            if (obj instanceof view.HTMLCollection)
  858
+            else if (arr instanceof view.HTMLCollection)
857 859
                 return true;
858  
-            else if (obj instanceof view.NodeList)
  860
+            else if (arr instanceof view.NodeList)
859 861
                 return true;
860 862
         }
861 863
 

0 notes on commit 326b4e3

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