Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
PR-4286:
Updated broken test
Used subarray instead of slice for typed array to support older browsers
  • Loading branch information
Justin Van Dort committed Oct 11, 2019
commit 7f3b2bb75f5018ee584e8128149be0beada97bf2
4 changes: 3 additions & 1 deletion src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,14 @@ lib.minExtend = function(obj1, obj2) {
v = obj1[k];
if(k.charAt(0) === '_' || typeof v === 'function') continue;
else if(k === 'module') objOut[k] = v;
else if(lib.isArrayOrTypedArray(v)) {
else if(Array.isArray(v)) {
if(k === 'colorscale') {
objOut[k] = v.slice();
} 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