diff options
author | Jesús <heckyel@hyperbola.info> | 2020-03-15 13:27:15 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-03-15 13:27:15 -0500 |
commit | 23e8cc80ecade58c9ba2722fdefcedb12ae1edf9 (patch) | |
tree | 91d87bb14c04438ecc3419385921ebc69158c3e2 | |
parent | 66a5b141fb64b19269ff5f95a084b58fdc076878 (diff) | |
download | ematrix-23e8cc80ecade58c9ba2722fdefcedb12ae1edf9.tar.lz ematrix-23e8cc80ecade58c9ba2722fdefcedb12ae1edf9.tar.xz ematrix-23e8cc80ecade58c9ba2722fdefcedb12ae1edf9.zip |
Use nsIURI as key
-rw-r--r-- | lib/HostMap.jsm | 6 |
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'); } |