00001 00002 var objectProto = Object.prototype; 00003 00005 var hasOwnProperty = objectProto.hasOwnProperty; 00006 00014 function initCloneArray(array) { 00015 var length = array.length, 00016 result = array.constructor(length); 00017 00018 // Add properties assigned by `RegExp#exec`. 00019 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 00020 result.index = array.index; 00021 result.input = array.input; 00022 } 00023 return result; 00024 } 00025 00026 module.exports = initCloneArray;