mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 12:27:49 +00:00
Realign _.assign and _.defaults with ES6 Object.assign. [closes #259]
Former-commit-id: e8c89e4a130ed286ce07e1a2e848f50b182effae
This commit is contained in:
@@ -585,6 +585,7 @@
|
|||||||
'while (++argsIndex < argsLength) {\n' +
|
'while (++argsIndex < argsLength) {\n' +
|
||||||
' iterable = args[argsIndex];\n' +
|
' iterable = args[argsIndex];\n' +
|
||||||
' if (iterable && objectTypes[typeof iterable]) {',
|
' if (iterable && objectTypes[typeof iterable]) {',
|
||||||
|
'arrays': false,
|
||||||
'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]",
|
'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]",
|
||||||
'bottom': ' }\n}'
|
'bottom': ' }\n}'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -706,6 +706,7 @@
|
|||||||
deepEqual(func({}, new Foo), {});
|
deepEqual(func({}, new Foo), {});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (methodName == 'merge') {
|
||||||
test('lodash.' + methodName + ' should treat sparse arrays as dense', function() {
|
test('lodash.' + methodName + ' should treat sparse arrays as dense', function() {
|
||||||
var array = Array(3);
|
var array = Array(3);
|
||||||
array[0] = 1;
|
array[0] = 1;
|
||||||
@@ -719,6 +720,7 @@
|
|||||||
ok(1 in actual);
|
ok(1 in actual);
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user