Skip to content

Commit

Permalink
Merge pull request #4268 from jtvd78/check-for-typed-array-in-minextend
Browse files Browse the repository at this point in the history
Check for typed array in minExtend
  • Loading branch information
etpinard authored Oct 15, 2019
2 parents 25fe1c9 + 7f3b2bb commit b3c1e7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ lib.minExtend = function(obj1, obj2) {
} else {
objOut[k] = v.slice(0, arrayLen);
}
} else if(lib.isTypedArray(v)) {
objOut[k] = v.subarray(0, arrayLen);
} else if(v && (typeof v === 'object')) objOut[k] = lib.minExtend(obj1[k], obj2[k]);
else objOut[k] = v;
}
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/scatter_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ describe('end-to-end scatter tests', function() {

var legendPts = d3.select('.legend').selectAll('.scatterpts');
expect(legendPts.size()).toBe(1, '# legend items');
expect(getColor(legendPts.node())).toBe('rgb(0, 0, 0)', 'legend pt color');
expect(getColor(legendPts.node())).toBe('rgb(0, 255, 0)', 'legend pt color');
expect(getMarkerSize(legendPts.node())).toBe(16, 'legend pt size');
})
.catch(failTest)
Expand Down

0 comments on commit b3c1e7a

Please sign in to comment.