Bug 1337743 - Count nsJSIID objects as objects; r?whimboo
MozReview-Commit-ID: IKzgAYEgAJe
--- 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