Bug 1467712 - Fail if Assert.ok is called with more than 2 arguments;r=Standard8

Depends on D10416

Differential Revision: https://phabricator.services.mozilla.com/D10417

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2018-11-01 13:50:22 +00:00
parent 079a123093
commit b346dbfd69

View File

@ -228,7 +228,11 @@ proto.report = function(failed, actual, expected, message, operator, truncate =
* (string) Short explanation of the expected result
*/
proto.ok = function(value, message) {
this.report(!value, value, true, message, "==");
if (arguments.length > 2) {
this.report(true, false, true, "Too many arguments passed to `Assert.ok()`", "==");
} else {
this.report(!value, value, true, message, "==");
}
};
/**