mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Remove support for flattening arrays with circular references.
This commit is contained in:
26
test/test.js
26
test/test.js
@@ -5276,32 +5276,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.flattenDeep');
|
||||
|
||||
(function() {
|
||||
QUnit.test('should flatten arrays with circular references', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
var array = [1, 2];
|
||||
array.push(array);
|
||||
|
||||
var expected = [1, 2, 1, 2];
|
||||
|
||||
try {
|
||||
var actual = _.flattenDeep(array);
|
||||
} catch (e) {}
|
||||
|
||||
assert.deepEqual(actual, expected);
|
||||
|
||||
array = [1, 2];
|
||||
array = [array, [array]];
|
||||
|
||||
assert.deepEqual(_.flattenDeep(array), expected);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('flatten methods');
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user