Bug 1337743 - Count nsJSIID objects as objects; r=whimboo, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 09 Feb 2017 16:35:07 +0000
changeset 395547 1af3c02b5dc2a0764a2bbd6868af3858717f4853
parent 395546 72400813edfd21b4d60e91a4ba5d7e107c181b88
child 395548 2cead05a41b740858a8989a6dc56de308f749ca6
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo, test-only
bugs1337743
milestone54.0a2
Bug 1337743 - Count nsJSIID objects as objects; r=whimboo, a=test-only MozReview-Commit-ID: IKzgAYEgAJe
testing/marionette/assert.js
--- a/testing/marionette/assert.js
+++ b/testing/marionette/assert.js
@@ -262,18 +262,20 @@ assert.string = function (obj, msg = "")
  * @return {Object}
  *     |obj| is returned unaltered.
  *
  * @throws {InvalidArgumentError}
  *     If |obj| is not an object.
  */
 assert.object = function (obj, msg = "") {
   msg = msg || error.pprint`Expected ${obj} to be an object`;
-  return assert.that(o =>
-      Object.prototype.toString.call(o) == "[object Object]", msg)(obj);
+  return assert.that(o => {
+    let s = Object.prototype.toString.call(o);
+    return s == "[object Object]" || s == "[object nsJSIID]";
+  })(obj);
 };
 
 /**
  * Asserts that |prop| is in |obj|.
  *
  * @param {?} prop
  *     Own property to test if is in |obj|.
  * @param {?} obj