Bug 1337743 - Count nsJSIID objects as objects; r?whimboo draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 09 Feb 2017 16:35:07 +0000
changeset 551791 d48b15969c77cd8cf1a8ed744681847078149f7c
parent 551789 9577ddeaafd85554c2a855f385a87472a089d5c0
child 551792 88f08a43ec9751ce80ac914cbcc34708c8b955d4
push id51152
push userbmo:ato@mozilla.com
push dateMon, 27 Mar 2017 12:36:48 +0000
reviewerswhimboo
bugs1337743
milestone55.0a1
Bug 1337743 - Count nsJSIID objects as objects; r?whimboo 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