Skip to content

Drop node4 for devs + a few more dep updates #2923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 17, 2018
Merged
2 changes: 1 addition & 1 deletion test/jasmine/assets/custom_matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var matchers = {
var i;
if(Array.isArray(x)) {
for(i = 0; i < x.length; i++) {
x[i] = x[i];
if(x[i] === undefined) x[i] = undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might look weird but we need this to make eslint@5 and npm run test-jasmine -- lib pass.

Ricky wrote:

// toEqual except with sparse arrays populated. This arises because:
//
// var x = new Array(2)
// expect(x).toEqual([undefined, undefined])
//
// will fail assertion even though x[0] === undefined and x[1] === undefined.
// This is because the array elements don't exist until assigned. Of course it
// only fails on *some* platforms (old firefox, looking at you), which is why
// this is worth all the footwork.
toLooseDeepEqual: function() {
function populateUndefinedArrayEls(x) {
var i;
if(Array.isArray(x)) {
for(i = 0; i < x.length; i++) {
if(x[i] === undefined) x[i] = undefined;
}
} else if(isPlainObject(x)) {
var keys = Object.keys(x);
for(i = 0; i < keys.length; i++) {
populateUndefinedArrayEls(x[keys[i]]);
}
}
return x;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOTW (wat of the week)

}
} else if(isPlainObject(x)) {
var keys = Object.keys(x);
Expand Down