further changes to avoid a validation warning about modifying a global variable
authorDamyan Ivanov <dmn@debian.org>
Thu, 20 Jan 2011 08:15:45 +0000 (10:15 +0200)
committerDamyan Ivanov <dmn@debian.org>
Thu, 20 Jan 2011 08:15:45 +0000 (10:15 +0200)
chrome/content/icedeb.js

index 391d253..061f3cd 100644 (file)
@@ -15,14 +15,18 @@ IceDeb = {
                 : clip.kGlobalClipboard
         );
 
-        var str = new Object;
-        var strLength = new Object;
-        trans.getTransferData("text/unicode", str, strLength);
+        var s = new Object;
+        var p;
+        var len = new Object;
+        trans.getTransferData("text/unicode", s, len);
 
         var text = null;
+        var res;
 
-        if (str) str  = str.value.QueryInterface(Components.interfaces.nsISupportsString);
-        if (str) text = str.data.substring(0, strLength.value / 2);
+        if (s)
+            p = s.value.QueryInterface(Components.interfaces.nsISupportsString, res);
+        if (p)
+            text = p.data.substring(0, len.value / 2);
 
         return text;
     },