aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-03-15 13:27:15 -0500
committerJesús <heckyel@hyperbola.info>2020-03-15 13:27:15 -0500
commit23e8cc80ecade58c9ba2722fdefcedb12ae1edf9 (patch)
tree91d87bb14c04438ecc3419385921ebc69158c3e2
parent66a5b141fb64b19269ff5f95a084b58fdc076878 (diff)
downloadematrix-23e8cc80ecade58c9ba2722fdefcedb12ae1edf9.tar.lz
ematrix-23e8cc80ecade58c9ba2722fdefcedb12ae1edf9.tar.xz
ematrix-23e8cc80ecade58c9ba2722fdefcedb12ae1edf9.zip
Use nsIURI as key
-rw-r--r--lib/HostMap.jsm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/HostMap.jsm b/lib/HostMap.jsm
index 308c825..59d4f65 100644
--- a/lib/HostMap.jsm
+++ b/lib/HostMap.jsm
@@ -23,13 +23,15 @@
'use strict';
+var Ci = Components.interfaces;
+
var EXPORTED_SYMBOLS = ['HostMap'];
var map = new Map();
var HostMap = {
put: function (key, value) {
- if (typeof key !== 'string' || typeof value !== 'string'
+ if (!(key instanceof Ci.nsIURI) || !(value instanceof Ci.nsIURI)
|| !key || !value) {
throw new Error('invalid argument(s)');
}
@@ -41,7 +43,7 @@ var HostMap = {
map.set(key, value);
},
get: function (key) {
- if (typeof key !== 'string' || !key) {
+ if (!(key instanceof Ci.nsIURI) || !key) {
throw new Error('invalid argument');
}