arrow functions dont have arguments (#4943)

This commit is contained in:
webzwo0i 2021-03-12 20:25:14 +01:00 committed by GitHub
parent 0b9bf4a78e
commit 8e2a21ec84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,10 +50,9 @@ exports.error = (msg) => {
* @param b {boolean} assertion condition
* @param msgParts {string} error to be passed if it fails
*/
exports.assert = (b, msgParts) => {
exports.assert = (b, ...msgParts) => {
if (!b) {
const msg = Array.prototype.slice.call(arguments, 1).join('');
exports.error(`Failed assertion: ${msg}`);
exports.error(`Failed assertion: ${msgParts.join('')}`);
}
};