mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
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:
parent
079a123093
commit
b346dbfd69
@ -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, "==");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user