mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Use new to create the array clone.
This commit is contained in:
@@ -6160,7 +6160,7 @@
|
|||||||
*/
|
*/
|
||||||
function initCloneArray(array) {
|
function initCloneArray(array) {
|
||||||
var length = array.length,
|
var length = array.length,
|
||||||
result = array.constructor(length);
|
result = new array.constructor(length);
|
||||||
|
|
||||||
// Add properties assigned by `RegExp#exec`.
|
// Add properties assigned by `RegExp#exec`.
|
||||||
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user