mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 04:37:50 +00:00
Fix _.isEqual test in environment w/o typed arrays.
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -4822,11 +4822,11 @@
|
|||||||
test('should perform comparisons between typed arrays', 1, function() {
|
test('should perform comparisons between typed arrays', 1, function() {
|
||||||
var pairs = _.map(typedArrays, function(type, index) {
|
var pairs = _.map(typedArrays, function(type, index) {
|
||||||
var otherType = typedArrays[++index % typedArrays.length],
|
var otherType = typedArrays[++index % typedArrays.length],
|
||||||
CtorA = root[type] || Array,
|
CtorA = root[type] || function(n) { this.n = n; },
|
||||||
CtorB = root[otherType] || Array,
|
CtorB = root[otherType] || function(n) { this.n = n; },
|
||||||
bufferA = CtorA == Array ? 8 : new ArrayBuffer(8),
|
bufferA = root[type] ? new ArrayBuffer(8) : 8,
|
||||||
bufferB = CtorB == Array ? 8 : new ArrayBuffer(8),
|
bufferB = root[otherType] ? new ArrayBuffer(8) : 8,
|
||||||
bufferC = CtorB == Array ? 16 : new ArrayBuffer(16);
|
bufferC = root[otherType] ? new ArrayBuffer(16) : 16;
|
||||||
|
|
||||||
return [new CtorA(bufferA), new CtorA(bufferA), new CtorB(bufferB), new CtorB(bufferC)];
|
return [new CtorA(bufferA), new CtorA(bufferA), new CtorB(bufferB), new CtorB(bufferC)];
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user