mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Make deep _.clone copy array properties assigned by RegExp#exec.
Former-commit-id: b465457babfc04e8204048dfaeff6e5d37e5e43c
This commit is contained in:
@@ -295,6 +295,14 @@
|
||||
ok(actual != expected && actual.a == expected.a && actual.b == expected.b);
|
||||
});
|
||||
|
||||
test('should deep clone `index` and `input` array properties', function() {
|
||||
var array = /x/.exec('x'),
|
||||
actual = _.clone(array, true);
|
||||
|
||||
equal(actual.index, 0);
|
||||
equal(actual.input, 'x');
|
||||
});
|
||||
|
||||
test('should deep clone objects with circular references', function() {
|
||||
var object = {
|
||||
'foo': { 'b': { 'foo': { 'c': { } } } },
|
||||
|
||||
Reference in New Issue
Block a user