Bug 1219028 - Remove use of non-standard Function.prototype.isGenerator from devtools/. r=fitzgen
authorTooru Fujisawa <arai_a@mac.com>
Wed, 28 Oct 2015 07:28:18 +0900
changeset 305135 bda42988725cb4ed31f56abc9ff7717d91adf64a
parent 305134 1d67c4e4858f3a6ea5bf39b31fe11bef3cd001ac
child 305136 fa8f6c1aa893ed085cfada7de6e7a6089b0f7409
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1219028
milestone44.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 1219028 - Remove use of non-standard Function.prototype.isGenerator from devtools/. r=fitzgen
devtools/shared/DevToolsUtils.js
--- a/devtools/shared/DevToolsUtils.js
+++ b/devtools/shared/DevToolsUtils.js
@@ -807,17 +807,28 @@ exports.openFileStream = function (fileP
 
         resolve(stream);
       }
     );
   });
 }
 
 exports.isGenerator = function (fn) {
-  return typeof fn === "function" && fn.isGenerator();
+  if (typeof fn !== "function") {
+    return false;
+  }
+  let proto = Object.getPrototypeOf(fn);
+  if (!proto) {
+    return false;
+  }
+  let ctor = proto.constructor;
+  if (!ctor) {
+    return false;
+  }
+  return ctor.name == "GeneratorFunction";
 };
 
 exports.isPromise = function (p) {
   return p && typeof p.then === "function";
 };
 
 /**
  * Return true if `thing` is a SavedFrame, false otherwise.