Skip to content

Commit 4fb53a0

Browse files
Gabriel Schulhofmhdawson
authored andcommitted
Fix test script for node 4.x
Node.js 4.x does not understand default parameter values. PR-URL: #169 Reviewed-By: Michael Dawson <[email protected]>
1 parent 7b2d8ad commit 4fb53a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/common/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ exports.mustCall = function(fn, exact) {
3434
return _mustCallInner(fn, exact, 'exact');
3535
};
3636

37-
function _mustCallInner(fn, criteria = 1, field) {
37+
function _mustCallInner(fn, criteria, field) {
3838
if (typeof fn === 'number') {
3939
criteria = fn;
4040
fn = noop;
4141
} else if (fn === undefined) {
4242
fn = noop;
4343
}
44+
if (criteria === undefined) {
45+
criteria = 1;
46+
}
4447

4548
if (typeof criteria !== 'number')
4649
throw new TypeError(`Invalid ${field} value: ${criteria}`);

0 commit comments

Comments
 (0)