Skip to content

Commit

Permalink
Do not memoize all URI objects to the same key.
Browse files Browse the repository at this point in the history
Fixes #1874
  • Loading branch information
arantius committed Mar 21, 2014
1 parent 59f0776 commit fc6ffb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/util/memoize.js
Expand Up @@ -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];

Expand Down

0 comments on commit fc6ffb5

Please sign in to comment.