bug 1523104: remote: test that method own property on domain class is function; r=ochameau
authorAndreas Tolfsen <ato@sny.no>
Sat, 23 Feb 2019 15:09:48 +0000
changeset 524105 b075e49fca677a355b12e28fcbe2f4ee6d533bf7
parent 524104 0d1d92205068322902f909a7b171a65ea765486f
child 524106 9ffed583c0e4d825ef12b6f95a5d92c811288c63
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1523104
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1523104: remote: test that method own property on domain class is function; r=ochameau
remote/domains/Domains.jsm
--- a/remote/domains/Domains.jsm
+++ b/remote/domains/Domains.jsm
@@ -10,17 +10,17 @@ class Domains extends Map {
   constructor(session, modules) {
     super();
     this.session = session;
     this.modules = modules;
   }
 
   domainSupportsMethod(name, method) {
     const domain = this.modules[name];
-    return domain && !!domain.prototype[method];
+    return domain && typeof domain.prototype[method] == "function";
   }
 
   get(name) {
     let inst = super.get(name);
     if (!inst) {
       inst = this.new(name);
       this.set(inst);
     }
@@ -48,13 +48,13 @@ class Domains extends Map {
     if (inst) {
       inst.off("*");
       inst.destructor();
       super.delete(inst.name);
     }
   }
 
   clear() {
-    for (const domainName of this.keys()) {
-      this.delete(domainName);
+    for (const name of this.keys()) {
+      this.delete(name);
     }
   }
 }