aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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');
}