Make deep _.clone copy array properties assigned by RegExp#exec.

Former-commit-id: b465457babfc04e8204048dfaeff6e5d37e5e43c
This commit is contained in:
John-David Dalton
2012-11-30 00:40:32 -08:00
parent 619ba13265
commit 6b35c097d6
4 changed files with 149 additions and 129 deletions

View File

@@ -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': { } } } },