[Pkg-mozext-commits] [greasemonkey] 08/15: Do not memoize all URI objects to the same key.

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 21:59:09 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit fc6ffb50f16f4590135115bd50a6729ab5fd53e2
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Fri Mar 21 12:11:51 2014 -0400

    Do not memoize all URI objects to the same key.
    
    Fixes #1874
---
 modules/util/memoize.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/util/memoize.js b/modules/util/memoize.js
index 995db16..12e42b7 100644
--- a/modules/util/memoize.js
+++ b/modules/util/memoize.js
@@ -16,6 +16,12 @@ function memoize(func, limit) {
 
   return function(a) {
     var args = Array.prototype.slice.call(arguments);
+    args.forEach(function(aVal, aIndex) {
+      if (aVal instanceof Components.interfaces.nsIURI) {
+        // See #1874
+        args[aIndex] = aVal.spec;
+      }
+    });
     var key = uneval(args);
     if (key in cache) return cache[key];
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list