Use new to create the array clone.

This commit is contained in:
John-David Dalton
2018-02-02 15:47:39 -08:00
parent b8c719d3be
commit 7cb477a3a0

View File

@@ -6160,7 +6160,7 @@
*/
function initCloneArray(array) {
var length = array.length,
result = array.constructor(length);
result = new array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {